Drawer layout над action bar

Рейтинг: 2Ответов: 1Опубликовано: 19.12.2014

Как сделать чтобы drawerlayout был поверх экшнбар. Сейчас код такой

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <android.support.v7.widget.Toolbar
        android:id="@+id/my_awesome_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        theme="@style/ThemeOverlay.AppCompat.ActionBar" />
    <android.support.v4.widget.DrawerLayout

        android:id="@+id/drawer_layout"
        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" />
        <ListView
            android:id="@+id/lv_navigation_drawer"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:background="@android:color/white" />

    </android.support.v4.widget.DrawerLayout>

</LinearLayout>

Ставил внутрь и под дроуер не получается.

Ответы

▲ 2Принят

1) Главным элементом сделайте DrawerLayout.

2) Дайте ему параметр

android:fitsSystemWindows="true"

3) Toolbar поместите внутрь FrameLayout, коий внутри DrawerLayout.

4) ???

5) Profit!