theme

时间:2015-01-30 14:47:39   收藏:0   阅读:185

theme用以定义android系统UI部分的风格,有两种方式设置:

1、在manefest里定义android:theme属性;

2、在activity的onCreate方法中调用:this.setTheme(R.style.NewTheme); 

newTheme定义在style.xml中,如下:

<resources>

    <style name="AppBaseTheme" parent="android:Theme.Light">
    </style>

    <style name="AppTheme" parent="AppBaseTheme">
    </style>
    
    <style name="NewTheme" parent="android:Theme.Dialog">  //对话框风格
        <item name="android:windowNoTitle">true</item>
        <item name="android:textSize">24sp</item> 
    </style>

</resources>

其中Theme.Dialog是Andriod自动的主题,包括:

Activity显示为对话框模式

 

item为能够修改的属性,包括是否要标题栏、字体、字体颜色等;

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!