我要如何更改为全息暗/灯光主题,从应用程序内?我要、全息、应用程序、如何更改

由网友(怎能叫做人生)分享简介:我知道这是可能有它,所以如果我有一个设置,我可以然而Holo.Light与河洛之间切换,我似乎无法找出如何。所有帮助是AP preciated!I know it's possible to have it so if I have a setting I can change between Holo.Light...

我知道这是可能有它,所以如果我有一个设置,我可以然而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

阅读全文

相关推荐

最新文章