Materialdrawer: AppBarLayoutを使用したツールバーの下のドロワー

作成日 2016年04月12日  ·  3コメント  ·  ソース: mikepenz/MaterialDrawer

以下は、 https

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity">

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

        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:popupTheme="@style/AppTheme.PopupOverlay"/>

        </android.support.design.widget.AppBarLayout>

        <FrameLayout
            android:id="@+id/drawer_layout"
            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">

            <include layout="@layout/content_main"/>

        </FrameLayout>
    </LinearLayout>

</android.support.design.widget.CoordinatorLayout>

ただし、RecyclerViewを追加すると、 タグは、フルスクリーンを占めるAppbarLayoutの上に表示されるRecylerViewです。 または、RecyclerViewを「drawer_layout」ビューの上に配置すると、レイアウトはスクロールできなくなります。

ツールバーの下にナビゲーションドロワーを配置したいのですが、概説した方法以外の方法はありますか?

前もって感謝します。

question

全てのコメント3件

CoordinatorLayoutが必要ない場合は、次のサンプルのように行うこともできます。
https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/CustomContainerActivity.java
https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/res/layout/activity_sample_custom_container_dark_toolbar.xml

上記では、 RecyclerViewはID drawer_layoutのレイアウト内にある必要があります。 代わりにinclude

@ Meeks91報告してください。 今のところ閉じます

同じ問題がありました。 あなたの解決策は魅力のように機能しました、ありがとう!

このページは役に立ちましたか?
0 / 5 - 0 評価