1

我正在开发一个带有 SlidingUpPanelLayout ( com.sothree.slidinguppanel.SlidingUpPanelLayout) 的应用程序。展开此布局时,它应该填满屏幕,直到状态栏的顶部。但是状态栏不是完全透明的。

我已经尝试将窗口标志设置为View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN,以及添加<item name="android:windowTranslucentStatus">true</item>为 true。它实际上适用于导航抽屉,但不适用于 SlidingUpPanelLayout。

活动主.xml:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/mDrawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.internal.ScrimInsetsFrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <include layout="@layout/layout_slidingpanel" />
    </android.support.design.internal.ScrimInsetsFrameLayout>

    <android.support.design.widget.NavigationView
        android:id="@+id/mNavigationView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/layout_drawer_header"
        app:menu="@menu/menu_drawer" />

</android.support.v4.widget.DrawerLayout>

layout_slidingpanel.xml:

<?xml version="1.0" encoding="utf-8"?>
<com.sothree.slidinguppanel.SlidingUpPanelLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sothree="http://schemas.android.com/apk/res-auto"
    android:id="@+id/mSlidingPanelLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    sothree:umanoOverlay="false"
    sothree:umanoPanelHeight="0dp"
    sothree:umanoShadowHeight="@dimen/cardview_default_elevation">

    <FrameLayout
        android:id="@+id/mActivityContent"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <FrameLayout
        android:id="@+id/slidingpanel"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <FrameLayout
            android:id="@+id/mPlayerContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <fragment
            class="at.guger.musixs.fragment.player.MiniPlayerFragment"
            android:id="@+id/mMiniPlayerFragment"
            android:layout_width="match_parent"
            android:layout_height="@dimen/miniplayer_height" />
    </FrameLayout>

</com.sothree.slidinguppanel.SlidingUpPanelLayout>

如何将状态栏设置为透明或如何创建布局以获得完全可见的布局?

提前致谢!

4

0 回答 0