Android 折叠工具栏布局中的内容顶部被工具栏背景色遮挡

Android 折叠工具栏布局中的内容顶部被工具栏背景色遮挡,android,google-maps,android-actionbar,android-support-design,Android,Google Maps,Android Actionbar,Android Support Design,当我使用Android设计支持库时,我发现我的应用程序有一个问题,折叠工具栏布局在顶部似乎有一个主题色的背景栏,即使有足够的空间,因此它应该是“透明的” 知道我做错了什么吗 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns

当我使用Android设计支持库时,我发现我的应用程序有一个问题,折叠工具栏布局在顶部似乎有一个主题色的背景栏,即使有足够的空间,因此它应该是“透明的”

知道我做错了什么吗

<android.support.design.widget.CoordinatorLayout
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:id="@+id/main_content"
android:layout_width="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout android:id="@+id/appbar"
    android:layout_width="match_parent" android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay"
    android:fitsSystemWindows="true">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="400dp"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:expandedTitleMarginEnd="64dp"
        app:expandedTitleMarginStart="48dp"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:fitsSystemWindows="true"
            app:layout_collapseMode="parallax">
            <fragment
                android:layout_width="match_parent"
                android:layout_height="match_parent" android:id="@+id/map"
                android:name="com.google.android.gms.maps.SupportMapFragment"
                />

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#66000000"
                android:layout_alignParentTop="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true" />
        </RelativeLayout>

        <android.support.v7.widget.Toolbar android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:layout_collapseMode="pin">

        </android.support.v7.widget.Toolbar>

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

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

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">
  <!-- content -->
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>

我在我的应用程序中有非常相似的布局,它对我来说很好。比较我的布局和你的布局,我猜你应该从工具栏中删除背景属性。此外,我为Toolbar@style/ThemeOverlay.AppCompat.Dark使用了一个默认主题。我看到您正在使用自己的主题,这可能也会造成问题。我在Java代码中将StatusBar颜色设置为透明,如果您对此也感兴趣的话