android - How to have a text view in my navigation drawer after menu items? -
i need have have text view after menu items, shouldn't responsive. needn't update programmatically. i'm using navigation drawer activity. create image out of text implementation of image view well. kind of this
i don't know use code , version make navigation menu. have 3 suggestions you. 1 of them below code if use 'android.support.design.widget.navigationview' :
<android.support.design.widget.navigationview android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start"> <linearlayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.navigationview android:id="@+id/navigation" android:layout_width="wrap_content" android:layout_height="0dp" android:layout_weight="1" app:menu="@menu/menu_drawer"> </android.support.design.widget.navigationview> <textview android:id="@+id/textview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0" android:text="your sentences" /> </linearlayout>
another below code, if use android.support.v4.widget.drawerlayout
:
<android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/content_frame"...../> <relativelayout android:id="@+id/relative_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" > <listview android:id="@+id/left_drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:choicemode="singlechoice" android:divider="@android:color/transparent" android:dividerheight="0dp" /> <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" > <textview android:id="@+id/text_view1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="your sentences" /> </relativelayout> </relativelayout> </android.support.v4.widget.drawerlayout>
and last suggestion use different list item in menu. use getviewtypecount()
, getitemviewtype(int position)
in adapter. see this link
Comments
Post a Comment