in app, i'm displaying toolbar home button visible. in screens works button, in others not.
that works fine.
problem when importing design support library, home button not shown in toolbar. happens importing it, not single line of code changed.
i'm importing in gradle with:
compile 'com.android.support:design:22.2.0' do need change in code design library not make home button disappear? bug in design library?
note, i'm using support lib like:
compile 'com.android.support:appcompat-v7:22.2.0' also, how inflate toolbar
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <!-- toolbar --> <framelayout android:id="@+id/toolbarcontainer" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparenttop="true"> <include layout="@layout/include_toolbar" /> </framelayout> [....] </relativelayout> this how set home button in 1 fragment.
@override public view oncreateview(layoutinflater inflater, viewgroup [....] final toolbar toolbar = (toolbar) view.findviewbyid(r.id.toolbar); toolbar.settitle(r.string.foo); toolbar.setnavigationicon(r.drawable.bar); [....] } as said, these works fine until import design lib in gradle.
thank you.
i personnaly toolbar set actionbar , use regular methods , works me.
hope helps you:
final toolbar toolbar = (toolbar) view.findviewbyid(r.id.toolbar); toolbar.settitle(r.string.foo); toolbar.setnavigationicon(r.drawable.bar); setsupportactionbar(toolbar); getsupportactionbar().setdisplayshowhomeenabled(true); getsupportactionbar().setdisplayhomeasupenabled(true);
Comments
Post a Comment