laobie / StatusBarUtil

A util for setting status bar style on Android App.
http://t.cn/Rq746Kb
Apache License 2.0
8.82k stars 1.72k forks source link

DrawerLayout中toolbar设置app:layout_scrollFlags="scroll|enterAlways"问题 #10

Closed homelajiang closed 8 years ago

homelajiang commented 8 years ago

当向上滑动时,本该被状态栏遮住的toolbar却显示在了状态栏上面,

        StatusBarUtil.setColorForDrawerLayout(this, drawer,
                ContextCompat.getColor(this,R.color.colorPrimary), 0);

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:contentInsetStart="0dp"
            app:layout_scrollFlags="scroll|enterAlways"
            >
laobie commented 8 years ago

这是一个已知bug,目前的兼容方案可以看#5 issue,在coordinatorLayout 外面加一个linearlayout…下个版本会尝试修复这个bug

homelajiang commented 8 years ago

代码和 #5 的代码基本上是一样的,最里面也是个viewpager,但是按照你的方法添加linearlayout之后,状态栏有颜色,但是,颜色是固定的(如图),并且设置任何颜色都无效 3

laobie commented 8 years ago

好像就第一次设置有效果…后面无法改变颜色,等我回去修复这个bug,修复好了通知你

homelajiang commented 8 years ago

好的,谢谢