my question related released navigation view
design support library
.
i want position log in
@ bottom of navigation view
, how can this? menu xml
right now, :
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkablebehavior="single"> <item android:id="@+id/navigation_sub_item_1" android:icon="@drawable/ic_action_event" android:title="@string/home" /> <item android:id="@+id/navigation_sub_item_2" android:icon="@drawable/ic_action_person" android:title="@string/profile" /> <item android:id="@+id/navigation_sub_item_3" android:icon="@drawable/ic_action_labels" android:title="@string/tags" /> <item android:id="@+id/navigation_sub_item_4" android:icon="@drawable/ic_action_settings" android:title="@string/log_in" /> </group> </menu>
here layout :
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/view" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:background="@color/white_1000"> <include android:id="@+id/toolbar" layout="@layout/toolbar" /> <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/toolbar"> <framelayout android:id="@+id/content_frame" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <android.support.design.widget.navigationview android:id="@+id/main_drawer" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" app:headerlayout="@layout/drawer_header" app:menu="@menu/drawer_menu" /> </android.support.v4.widget.drawerlayout> </relativelayout>
do want "log in" item fixed @ bottom of navigation view?
you can nesting additional views/layouts within navigationview
. navigationview extends framelayout
, can wrap around child views.
i posted more information on navigationview footers here. see other answers in post more layout options.
edit
fyi: if use "fixed footer" approach, removing footer item (e.g. "log in" in example) menu. means have implement click , other handlers yourself.
Comments
Post a Comment