导航抽屉覆盖了我的工具栏

Adi*_*han 0 android android-actionbar navigation-drawer material-design

我正在使用这个材料设计导航抽屉的示例,问题是,当我打开抽屉时,它也覆盖了我的操作栏..并且我的抽屉图标不可见..这就是我得到的..下面是我的代码..

<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>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Tho*_* R. 5

我建议使用垂直方向的线性布局作为父级,然后第一个子级是您的工具栏,第二个是抽屉布局。

linearlayout vertical
  toolbar
  drawerlayout
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助。