android - drawer not covering actionbar -
i want open drawer such covers actionbar. tried using parent linear layout , inside defined toolbar , drawerlayout , working fine thing cant see menu item there.. can open drawer swiping left right on screen. if define toolbar outside of linear layout menu showing actionbar not covered drawer. how achieve both of them simultaneously? here xml file of activity_main
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools" android:background="@color/white" android:fitssystemwindows="true" android:layout_height="match_parent" android:orientation="vertical" tools:context="variofitness.com.schedulekeeper.homeactivity"> <include android:id="@+id/toolbar_actionbar" layout="@layout/toolbar_default" android:layout_margintop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" /> <android.support.v4.widget.drawerlayout android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent"> <framelayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" android:clickable="true" /> <fragment android:id="@+id/fragment_drawer" android:name="variofitness.com.schedulekeeper.fragments.navigationdrawerfragment" android:layout_width="@dimen/navigation_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" app:layout="@layout/fragment_navigation_drawer" /> </android.support.v4.widget.drawerlayout>
try way help
<android.support.v4.widget.drawerlayout 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:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:id="@+id/container_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <include android:id="@+id/toolbar" layout="@layout/toolbar" /> </linearlayout> <framelayout android:id="@+id/container_body" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" /> </linearlayout> <fragment android:id="@+id/fragment_navigation_drawer" android:name="info.androidhive.materialdesign.activity.fragmentdrawer" android:layout_width="@dimen/nav_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" app:layout="@layout/fragment_navigation_drawer" tools:layout="@layout/fragment_navigation_drawer" /> </android.support.v4.widget.drawerlayout>
Comments
Post a Comment