Android AppCompat材质设计色调状态栏

时间:2015-04-08 15:27:56

标签: android android-appcompat android-statusbar

我想实现材料设计指南中描述的状态栏,其颜色应比工具栏深20%。 我设置了以下样式:

Styles.xml

<item name="android:windowTranslucentStatus">true</item>

Style.xml(v21)

<item name="android:windowTranslucentStatus">true</item>

但是我得到了比预期更完整的布局。

模拟器4.4

enter image description here

模拟器5.0.1

enter image description here

Sony Z3 5.0.1

enter image description here

是否有适当的技术使状态栏显示20%(即使是代码),在状态栏的背面发送工具栏和抽屉,避免在工具栏上使用 FitSystemWindows 在我的屏幕上?

1 个答案:

答案 0 :(得分:1)

我认为这就是你要找的东西: https://github.com/jgilfelt/SystemBarTint

请注意,它仅适用于Android 4.4(KitKat),在4.4之前无法在Android版本上设置系统栏。