状況・お聞きしたいこと
androidでfragmentを使ったアプリを作成しています。
表示してみましたが、アクションバーの裏側にもfragmentの表示領域が重なっていてしまいます。
アクションバーの下からホームボタンなどを表示している領域の上部分までをfragmentの領域に設定したいです。
色々と調べてみましたが、これといった答えが得られませんでした。
どなたかご教授いただけないでしょうか。
よろしくお願いいたします。
コード
xml
1<?xml version="1.0" encoding="utf-8"?> 2<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 android:id="@+id/navigation_drawer_layout" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent" 7 android:fitsSystemWindows="@bool/fitsSystemWindows"> 8 9 <LinearLayout 10 android:layout_width="match_parent" 11 android:layout_height="wrap_content" 12 android:orientation="vertical"> 13 14 <FrameLayout 15 android:layout_width="match_parent" 16 android:layout_height="@dimen/status_bar_kitkat_height" 17 android:background="?colorPrimary"/> 18 19 <FrameLayout 20 android:layout_width="match_parent" 21 android:layout_height="@dimen/status_bar_lollipop_height" 22 android:background="?colorPrimaryDark"/> 23 24 </LinearLayout> 25 26 <FrameLayout 27 android:layout_width="match_parent" 28 android:layout_height="wrap_content" 29 android:layout_marginTop="@dimen/status_bar_margin_top"> 30 31 <FrameLayout 32 android:id="@+id/fragment" 33 android:layout_width="match_parent" 34 android:layout_height="match_parent"/> 35 36 <android.support.v7.widget.Toolbar 37 android:id="@+id/toolbar" 38 android:layout_width="match_parent" 39 android:layout_height="?actionBarSize" 40 android:background="?attr/colorPrimary" 41 android:elevation="4dp" 42 app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 43 app:theme="@style/ToolbarTheme" /> 44 45 </FrameLayout> 46 47 <android.support.design.widget.NavigationView 48 android:id="@+id/navigation_view" 49 android:layout_width="wrap_content" 50 android:layout_height="match_parent" 51 android:layout_gravity="start" 52 android:fitsSystemWindows="@bool/fitsSystemWindows" 53 app:headerLayout="@layout/navigation_drawer_header" 54 app:menu="@menu/navigation_drawer_menu" 55 app:theme="@style/NavigationViewTheme" /> 56 57</android.support.v4.widget.DrawerLayout> 58
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/06 17:02
2016/07/06 17:43
2016/07/07 06:18