【问题标题】:Android navigation bar loses color on landscapeAndroid导航栏在横向上失去颜色
【发布时间】:2015-09-08 16:54:17
【问题描述】:

我选择了一种导航栏颜色,它在纵向模式下效果很好,但是当我切换到横向时,它又变回黑色,这是我的样式表

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
    <!-- Main theme colors -->
    <!--   your app branding color for the app bar -->

    <item name="colorPrimary">@color/ColorPrimary</item>
    <!--   darker variant for the status bar and contextual app bars -->
    <item name="colorPrimaryDark">@color/darkestGray</item>
    <!--   theme UI controls like checkboxes and text fields -->
    <item name="colorAccent">@color/ColorPrimary</item>
    <item name="android:navigationBarColor">@color/darkestGray</item>
    <item name="android:textColorPrimary">#FFFFFF</item>
    <item name="android:textColor">#FFFFFF</item>

</style>

提前致谢。

【问题讨论】:

  • 试试这个getWindow().setNavigationBarColor(getResources().getColor(R.color.navigation_bar_color));

标签: android colors navigation navigationbar


【解决方案1】:

我解决了这个问题。我们无法在棒棒糖下为横向导航栏设置颜色。但是我们可以暂时将这些版本设置为透明。您设置的标志是 View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY。

【讨论】:

  • 如何设置这个标志?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-04
  • 2016-01-11
  • 1970-01-01
  • 2020-11-09
  • 1970-01-01
相关资源
最近更新 更多