Android如何使状态栏完全半透明的属性android:windowTranslucentStatus in lollipop +?

时间:2017-03-13 07:11:46

标签: android google-play statusbar

以下是我的实施(此处仅链接,对不起):enter image description here

如果我使用android:windowTranslucentStatus=trueandroid:fitsSystemWindows=true,状态栏中仍有一个图层,但我想将其设为Google Play:enter image description here

在Google Play应用中,状态栏完全半透明。怎么样?

这是我的代码:

<?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:fitsSystemWindows="true">
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="?attr/actionBarSize"
        android:fitsSystemWindows="true">
        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:contentScrim="?attr/colorPrimary">
            <ImageView
                android:id="@+id/fuli"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:minHeight="160dp"
                android:scaleType="centerCrop"
                android:fitsSystemWindows="true"
                app:layout_collapseMode="parallax"/>
            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:fitsSystemWindows="false"
                app:layout_collapseMode="pin"/>
        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>
    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="88dp"
        android:clipToPadding="false"
        android:scrollbars="vertical"
        android:scrollbarStyle="outsideOverlay"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
<style name="DailyTheme" parent="Theme.Design.Light">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowTranslucentStatus">true</item>
</style>

0 个答案:

没有答案