Android 横向导航栏失去颜色
Android navigation bar loses color on landscape
我选择了一种导航栏颜色,它在纵向模式下效果很好,但当我切换到横向模式时,它又变回黑色,这是我的风格sheet
<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>
提前致谢。
我解决了这个问题。我们不能在棒棒糖下为横向导航栏设置颜色。但是我们可以暂时将这些版本设置为透明。您设置的标志是 View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY.
我选择了一种导航栏颜色,它在纵向模式下效果很好,但当我切换到横向模式时,它又变回黑色,这是我的风格sheet
<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>
提前致谢。
我解决了这个问题。我们不能在棒棒糖下为横向导航栏设置颜色。但是我们可以暂时将这些版本设置为透明。您设置的标志是 View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY.