我正在尝试Status bar
使用PrimaryDarkColor
And PrimaryColor
like Lollipop on Kitkat 来实现这一点,这是我的尝试:
<style name="PopularTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimaryDark">@color/colorPrimaryDarkPopular</item>
<item name="colorPrimary">@color/ColorPrimaryPopular</item>
<!--here is what I've added to try to get transparency -->
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
此外,我使用https://github.com/jgilfelt/SystemBarTint测试此方法,但这不是我的选择,因为我为每个活动使用另一种颜色。
如何使用KitkatPrimaryDarkColor
和PrimaryColor
在 Kitkat 中实现该状态栏?
结果: