I want to open the box so that it closes the action bar. I tried using the parent linear layout and inside it I defined the toolbar and drawerLayout and it works fine, but the thing is, I can’t see the menu item is .. that is, I can open the box only to scroll from left to right on the screen. if I define a toolbar outside the linear layout than the menu shows, but the action bar is not covered by the box. How to reach both of them at the same time? here is my xml file 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>
source
share