Android 导航栏在横向上失去颜色

标签 android colors navigation navigationbar

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

<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>

提前致谢。

最佳答案

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

关于Android 导航栏在横向上失去颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32463242/

相关文章:

android - 在位图上绘制文本失败

ubuntu - 调整 XTerm 字体颜色?

c# - ComboBoxItem 背景 rainbowRGB 颜色

python interactive plot 最新的颜色线,其余为黑色

javascript - jQuery 导航菜单插件推荐

android - 如何将 zip map 文件复制到/sdcard/osmdroid/(内部存储)

Android sys.powerctl 属性

android - 在 Android 上使用 XMPP 实现聊天应用程序的更好方法?

html - 内联列表大小问题

ios - 同时使用导航 Controller 和标签栏