Translucent StatusBar on kitkat with FrameLayout above the Toolbar and using CoordinatorLayout

浪尽此生 提交于 2019-12-04 20:36:08

Can you not just do this? It seems like you're moving your faux status bar into the Coordinator layout when you don't need to?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">

<FrameLayout
    android:id="@+id/statusbar"
    android:layout_width="match_parent"
    android:layout_height="25dp"
    android:background="@color/colorPrimaryDark" />

<Coordinator>
    <AppBarLayout>
        <CollapsibleToolbarLayout>
            <Toolbar/>
        </CollapsibleToolbarLayout>
    </AppBarLayout>
    <NestedScrollView/>
</Coordinator>
</LinearLayout>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!