状态栏的 Android AppCompat Material 设计色调

标签 android android-appcompat android-statusbar

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

样式.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

索尼 Z3 5.0.1

enter image description here

是否有适当的技术使状态栏 20% 透明(甚至通过代码),将工具栏和抽屉发送到状态栏的背面并避免在工具栏上使用 FitSystemWindows 拉伸(stretch)满屏都是?

最佳答案

我想这就是您要找的: https://github.com/jgilfelt/SystemBarTint

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

关于状态栏的 Android AppCompat Material 设计色调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29518938/

相关文章:

android - 如果我更改 ListItem 的内容,请刷新 ListView

java - Android studio 3.0.1使用库时无法合并dex?

android.support.v7.widget.AppCompatSpinner 如何更改 TextColor/Style

android - AppCompat v22 : Reference new interpolators via XML

android - 工具栏 - 灯光标题和灯光菜单

Android DrawerLayout(带有NavigationView)位于状态栏后面

Android - 使 Activity 全屏并在其顶部显示状态栏

android - 按当前日期查询 CallLog.Calls

android - 如何使用 sax 解析器解析像这样丑陋的结构化 XML

android - 如何实现半透明StatusBar和ActionBar的无缝过渡?