0
    <android.support.v4.widget.DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        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">

    <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_height="wrap_content"
            app:theme="@style/ThemeOverlay.AppCompat.ActionBar"
            android:minHeight="?attr/actionBarSize"
            android:layout_width="match_parent"
            android:background="@color/main_color"
            >
        </android.support.v7.widget.Toolbar>


        <FrameLayout
            android:id="@+id/left_drawer"
            android:layout_width="300dp"
            android:layout_height="match_parent"
            android:layout_gravity="left" />
        <FrameLayout
            android:id="@+id/view_main"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


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

次のコンポーネントを構成しようとしています

ツールバー (Appcompat v7 バージョン)

ナビゲーションドロワー

しかし、私のツールバーはGoogleキープのようにナビゲーションバーの後ろにある必要がありますか?

4

3 に答える 3

0

答えを見つけた

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.v7.widget.Toolbar

            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/main_color"
            android:minHeight="?attr/actionBarSize"></android.support.v7.widget.Toolbar>

        <FrameLayout
            android:id="@+id/view_main"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true" />
    </LinearLayout>

       <FrameLayout
        android:id="@+id/left_drawer"
        android:layout_width="300dp"
        android:layout_height="match_parent"
        android:layout_gravity="left"
        android:fitsSystemWindows="true" />


</android.support.v4.widget.DrawerLayout>
于 2015-04-27T12:44:50.707 に答える