我想改变我的整个应用程序的主题 [英] I want to change the theme of my whole application

查看:159
本文介绍了我想改变我的整个应用程序的主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图改变的主题的我的应用程序对按钮点击。我在活动定义的的onClick()函数

I am trying to change Theme of my application on button click. I have defined an onClick() function in my Activity.

我的code:

public class Screen2 extends Activity{
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.secondscreen);
}

public void theme(View view){       
    getApplication().setTheme(android.R.style.Theme_Holo);
}

这是行不通的。你能帮我改变我的应用程序的主题?

It doesn't work. Could you please help me to change theme of my application?

先谢谢了。

推荐答案

此处是很好的教程改变对按钮点击主题

Here is the nice tutorial for changing the theme on Button click

这里是造型教程Android版默认

and also Here is the tutorial for the Styling Android With Defaults

这篇关于我想改变我的整个应用程序的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆