android - How to keep the header of Navigation Drawer Fixed ie Non Scrolling header? -
how can keep header of navigation drawer fixed , content below scrolling?
what want header of navigation drawer should fixed ie non scrollable content part should scroll
how can that? content of navigation drawer menu file.
activity_main.xml
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.appbarlayout android:id="@+id/view" android:elevation="10dp" app:elevation="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <include layout="@layout/toolbar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" /> <android.support.design.widget.tablayout android:id="@+id/tablayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabgravity="fill" app:tabmode="scrollable" app:tabtextappearance="@style/mytabstyle"> </android.support.design.widget.tablayout> </android.support.design.widget.appbarlayout> <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent"> </android.support.v4.view.viewpager> <android.support.design.widget.navigationview android:id="@+id/navigation_view" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" app:headerlayout="@layout/nav_header" app:menu="@menu/drawer_menu"> <!----> </android.support.design.widget.navigationview> </android.support.v4.widget.drawerlayout> </linearlayout>
navigation header xml
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="120sp" android:background="@color/colorprimary" android:gravity="bottom" android:orientation="vertical" android:padding="@dimen/activity_horizontal_margin"> <imageview android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" android:src="@drawable/app_icon" /> </linearlayout>
Comments
Post a Comment