How To Change The Drawer Title?
I am new in Android and working on a App. I am trying to develop an App having drawer layout. Everything is fine but I can't change the Title of the drawer menu as marked on the sc
Solution 1:
You can add custom header layout. https://developer.android.com/training/implementing-navigation/nav-drawer#HeaderLayout
Solution 2:
More Customization
If you want more customization for Your Drawer. You can create a Layout for Drawer and include it in android.support.design.widget.NavigationView
Like this
</android.support.v4.widget.DrawerLayout>
...........
<!- Drawer >
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="150dp"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:layout_gravity="left"
>
<!--- Your custom layout >
<include layout="@layout/custom_drawer_layout"
android:id="@+id/filterDrawer"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_gravity="end"
/>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
Then you can create a Layout for custom_drawer_layout
custom_drawer_layout.xml
<RelativeLayout><spinner/><button/><whatever/></RelativeLayout>
Hope you get the idea. You can see a related project here
Post a Comment for "How To Change The Drawer Title?"