Android使用系统样式及主题
2012-11-18 03:04
381 查看
主题一般是针对整个Activity而言的,样式是针对某个具体的控件而言的 1 在清单文件中使用系统主题,方式如下: <activity android:name=".MainActivity" android:theme="@android:style/Theme.Dialog" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 2 在代码中使用系统主题,方式如下: this.setTheme(android.R.style.Theme); 3 某个控件设置风格,方式如下: <Button style="@android:style/ButtonBar" android:id="@+id/button" android:layout_width="fill_parent" android:layout_height="wrap_content" />
4 使用系统自带的style,方式如下:
<ProgressBar style="?android:attr/progressBarStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" />
重要参考资料:
http://blog.csdn.net/xiaomao5200/article/details/7497691
相关文章推荐
- Android系统自带主题样式总结及使用
- Android使用系统样式及主题
- android 主题和样式-style和Theme的区别和使用
- android 中系统自带的主题与样式
- Android如何使用样式和主题
- 【转】Android学习系列(39)--Android主题和样式之系统篇(上)
- Android主题和样式之系统篇(上)
- android 中系统自带的主题与样式
- Android学习系列(39)--Android主题和样式之系统篇(上)
- Android主题和系统样式篇(下)
- 【史上最全】android 中系统自带的主题与样式
- android 系统自带主题和样式
- Android关于系统自带样式和主题
- Android学习系列(40)--Android主题和样式之系统篇(下)
- Android学习系列(40)--Android主题和样式之系统篇
- Android学习系列(39)--Android主题和样式之系统篇(上)
- Android使用系统自动SDK V7库实现切换主题
- android系统自带的主题与样式(theme and style)
- android 如何使用手机厂商封装系统相应版本的样式
- Android中的动画,选择器,样式和主题的使用