【问题标题】:Changing the Status bar color on Android kitkat更改 Android kitkat 上的状态栏颜色
【发布时间】:2016-02-14 04:19:24
【问题描述】:

嘿,我正在尝试将状态栏的颜色更改为与操作栏颜色相同(可能是透明的)。在 Android Lolipop 上这不是问题,但在 Kitkat it looks like on this picture

我尝试了许多其他解决方案,但仍然无法解决。

这里是 v19 xml 样式

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>

</style>

【问题讨论】:

标签: android xml android-studio android-5.0-lollipop android-4.4-kitkat


【解决方案1】:

这在 Android 4.4 API 级别 19 中是不可能的。 您可以从 Android 5.0 API 级别 21 及更高版本开始执行此操作。

【讨论】:

  • 半透明状态是在 API 19 中引入的,因此可以使其半透明并在其下方添加颜色
  • @Zielony 这是一种变通方法,而不是一个优雅的解决方案。
猜你喜欢
  • 2023-03-12
  • 2020-03-07
  • 2015-05-09
  • 2015-04-13
  • 1970-01-01
  • 1970-01-01
  • 2016-09-08
  • 2021-08-03
  • 1970-01-01
相关资源
最近更新 更多