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)/: