私はAndroidアプリを開発中です。私のアプリでは、材料引き出し-を使用して、引き出しを左側に設定しています。私は引き出しを簡単にセットアップできます。しかしそれは問題を抱えている。以下のスクリーンショットのようなシステムウインドウに常に収まります。画面は常にAndroidのシステムWindowsに適合素材引き出し
これは私が活動に引き出しを設定する方法です。
private void setUpLeftDrawer()
{
DrawerBuilder builder = new DrawerBuilder()
.withActivity(this)
.withToolbar(toolbar);
if(areas!=null && areas.size()>0)
{
for(Area area: areas)
{
PrimaryDrawerItem item = new PrimaryDrawerItem().withIdentifier(area.getId()).withName(area.getName());
builder.addDrawerItems(item);
}
}
builder.build();
}
これは私のmain_activity xmlです。
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="false"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- This LinearLayout represents the contents of the screen -->
<!-- The ActionBar displayed at the top -->
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:fitsSystemWindows="false"
android:id="@+id/toolbar"
android:minHeight="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:titleTextColor="@android:color/white"
>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<!-- The main content view where fragments are loaded -->
</RelativeLayout>
だから、私はそれがシステムWindowsに合うようにしたくありません。私のコードをシステムウインドウに合わせないように修正するにはどうすればいいですか?
私は、それは同様に機能していない
<item name="android:fitsSystemWindows">false</item>
だけでなく、スタイルXMLでこれを設定してみました。
<item name="android:windowTranslucentStatus">true</item>
を削除<項目名= "アンドロイド:fitsSystemWindows">真 –を私はシステムWindows @DushyantSutharにフィットするようにしたくありません。私はxmlスタイルのテーマで修正しようとしました。しかし、それは私が問題に言及したように機能していません。 –
あなたはすでに問題を解決しましたか?なぜfitsSystemWindows = trueを使用したくないのですか?あなたはサンプルを見たことがありますか? – mikepenz