niorgai / StatusBarCompat

Status Bar Utils ---- Change Status Bar Mode Simply

Home Page:http://niorgai.github.io/2016/03/20/Android-transulcent-status-bar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

5.1 系统, setStatusBarColorForCollapsingToolbar 会撑上去状态栏

zongyao2 opened this issue · comments

commented

bug:CollapsingFragment 在 5.1 系统中,布局会撑上去状态栏,4.4 就没问题的。
经过测试,发现以下 2 个方法,都可以解决:
1、在 MainActivity 的根布局加上 android:fitsSystemWindows="true" 可以修复这个问题;
2、不改动代码,只将项目中的兼容库版本 supportVersion : "24.2.1" ,升级为最新的 25.1.0 ,也修复了。

commented

感谢反馈, 我不建议使用 android:fitsSystemWindows="true" 来切换, 在多 tab 时无法不重启 Activity 来切换这个属性. 另外我会更新 support 包版本, 同时更新 readme , 不建议采用库中的 support 包版本, support 包版本应该跟随你的项目.

commented

嗯,好的。那看来目前只能更新 support 包版本了

commented

对比了几个透明状态栏的开源库,发现作者你这边的,是使用最简单,并且兼容性最好的,支持!一直在找解决 5.1 系统透明状态栏默认阴影的办法,在你这里找到了 translucentStatusBar(Activity activity, boolean hideStatusBarBackground)。
并且刚好项目也用到 CollapsingFragment 那种效果,也兼容了 4.4 系统

commented

https://github.com/lcokean/StatusBarDemo
这位作者,发现了你库中的 bug,请你看看

commented

呃 我看他的 commit 记录是3个月前..我这个一直有维护的..

commented

感谢认可, 还是建议看看我的博客中的实现思路, 因为每个库都很难完全附和你的项目需求, 所以最好知道远离然后可以做自己的实现. 我在项目中用到的另一个方法就没有贴出来..

commented

你好 试试这样去引用这个库, 自己定义 support 包的版本:

        compile ('com.github.niorgai:StatusBarCompat:2.1.1', {
             exclude group: 'com.android.support'
        })
commented

嗯嗯,好的。感谢哈~~