应用程序兼容性DayNight主题始终显示为淡主题? [英] AppCompat DayNight theme always appears as a Light theme?
本文介绍了应用程序兼容性DayNight主题始终显示为淡主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的应用程序兼容性的新Theme.AppCompat.DayNight主题的版本23.2 ,但不是自动一日(光)和夜间(黑暗)的主题间切换时,它总是显示为浅色主题。我怎样才能得到它切换到一个黑暗的主题?
I am using the new Theme.AppCompat.DayNight theme of AppCompat introduced in version 23.2, but instead of switching between a day (light) and night (dark) theme automatically, it always appears as a light theme. How can I get it to switch to a dark theme?
推荐答案
有似乎是在Android的棒棒糖与应用程序兼容性的 23.2.0 错误:的谷歌问题跟踪
There seems to be a bug in Android Lollipop with AppCompat 23.2.0: Google Issue Tracker
以下code只做工作pre-棒棒糖:
The following code does only work pre-Lollipop:
public class MyApplication extends Application {
static {
AppCompatDelegate.setDefaultNightMode(
AppCompatDelegate.MODE_NIGHT_YES);
}
[...]
}
这篇关于应用程序兼容性DayNight主题始终显示为淡主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文