Android CoordinatorLayout使FrameLayout落在底部导航栏的后面

Android CoordinatorLayout使FrameLayout落在底部导航栏的后面,android,android-coordinatorlayout,android-support-design,coordinator-layout,Android,Android Coordinatorlayout,Android Support Design,Coordinator Layout,这是我的活动XML: <?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" android:layout_width="m

这是我的活动XML:

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    android:fitsSystemWindows="true">

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

    <FrameLayout
        android:id="@+id/frameLayoutContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

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

我用ConstraintLayout根片段替换
frameLayoutContainer
。它的底部有一个按钮视图,受app:layout\u constraintBottom\u toBottomOf=“parent”

但是按钮视图落在导航栏后面。我有许多活动几乎与此结构相同,但它们没有这样的问题


当我将CoordinatorLayout替换为LinearLayout时,问题就解决了,但我想知道CoordinatorLayout有什么问题?

app:layou\u behavior=“@string/appbar\u scrolling\u view\u behavior”
完成了所有工作。尝试从XML文件中删除这一行,即使不将
frameLayoutContainer
替换为
Fragment
,也会看到问题发生


因此,解决方案是将这一行
app:layout\u behavior=“@string/appbar\u scrolling\u view\u behavior”
添加到片段的根目录中(在XML中或以编程方式)并进行检查。

您将哪种样式应用于此活动?再想想,尝试删除android:fitsystemwindows=“true”从根布局元素中@Egemen Hamutçu检查了吗?