1
有些东西不起作用,我不知道这只是模拟器的问题还是它是Android Oreo中的错误(我没有Android O物理设备),但是我不能像Marschmallow那样从黑暗转变为光明状态栏主题。在Android上切换状态栏颜色的问题O
样式(从API 23):
<resources>
<style name="ThemeLight" parent="MyBaseTheme">
<item name="android:windowBackground">?attr/colorPrimary</item>
<item name="android:statusBarColor">?attr/colorPrimary</item>
<item name="android:windowLightStatusBar">true</item>
</style>
<style name="ThemeDark" parent="MyBaseThemeDark">
<item name="android:windowBackground">?attr/colorPrimary</item>
<item name="android:statusBarColor">?attr/colorPrimary</item>
<item name="android:windowLightStatusBar">false</item>
</style>
</resources>
在Android的棉花糖,当我更改主题与setTheme()
工作正常,但在Android的O,一旦我切换到光的主题,它不再改变,状态栏保持黑暗(windowLightStatusBar = true)/: