我爲我的項目選擇了導航抽屜活動。導航抽屜活動與我的內容重疊
我打算在這個項目中使用Fragments。當我嘗試顯示片段時,工具欄會重疊到片段內容上。
我很確定這是我的XML的問題,但不知道在哪裏。 activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/content_main"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
我content_main.xml包含一個空的框架佈局,使我可以添加使用的交易片段。我的片段內容出現,但頂部被工具欄隱藏。
你使用任何看法尋呼機? –