我要如何更改为全息暗/灯光主题,从应用程序内? [英] How do I change to a Holo Dark/Light themes from within the app?
本文介绍了我要如何更改为全息暗/灯光主题,从应用程序内?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道这是可能有它,所以如果我有一个设置,我可以然而Holo.Light与河洛之间切换,我似乎无法找出如何。所有帮助是AP preciated!
I know it's possible to have it so if I have a setting I can change between Holo.Light and Holo, however, I cannot seem to find out how. All help is appreciated!
推荐答案
我认为,你可以使用 setTheme()
办法做到这一点。只要确保你怎么称呼它,你之前使用的setContentView
,否则将无法正常工作。
I think that you can do it by using the setTheme()
method. Just make sure that you call it before you use setContentView
, or it won't work.
例如:
if(userChoice ==1){
setTheme(android.R.style.Theme_Holo_Light);
else if(userChoice == 2){
setTheme(android.R.style.Theme_Holo);
}
这里
A list of themes can be found here
这篇关于我要如何更改为全息暗/灯光主题,从应用程序内?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文