appbar下的android空间

TCE*_*TCE 2 android android-toolbar

我试图将两个放在Fragments一起,但是我无法摆脱它ActionBar和我的应用程序内容之间的空间:

工具栏间距截图

这是我的 XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:fitsSystemWindows="true"
    android:layout_height="match_parent"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:elevation="0dp"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.tce.manager.MainActivity"
    tools:showIn="@layout/app_bar_main">

    <fragment
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="2dp"
        android:name="com.tce.manager.DeviceListFragment"
        android:layout_weight="3"
        android:id="@+id/fragment_device_list" />

    <FrameLayout
        android:background="@android:color/darker_gray"
        android:elevation="0dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="2" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我已经尝试更改marginspadding为工具栏和AppBarLayout

Shr*_*hna 5

去掉 android:fitsSystemWindows="true"

如果设置为true,则调整此视图的填充以为系统窗口留出空间.