自定义一个Theme
来源:互联网 发布:3d效果图软件 编辑:程序博客网 时间:2024/06/08 08:00
1. 继承已有Theme(不然写的属性就太多了)
在自己的某个style.xml或者theme.xml中加上
2.实现具体的属性
1). custom_list_selector_holo_light.xml是放在res/drawable/下,可以指定一个随点击或者按下产生不同效果的图片,
2). @style/CustomActonbar是自己写的style
修改/res/values/style.xml
上面的两个属性是自定义ActionBar的背景色:wind_titlebar_background.png和字体颜:@*android:color/white
wind_titlebar_background.png为ActionBar的背景图片
在自己的某个style.xml或者theme.xml中加上
<style name = "Theme_Custom" parent="@*android:style/Theme.Holo.Light"><item name = "android:listChoiceBackgroundIndicator">@drawalbe/custom_list_selector_holo_light></item><item name = "android:actionBarStyle">@style/CustomActonbar></item></style>以上自定义list的背景色:custom_list_selector_holo_light
2.实现具体的属性
1). custom_list_selector_holo_light.xml是放在res/drawable/下,可以指定一个随点击或者按下产生不同效果的图片,
<selector xmlns:android=""http://schemas.android.com/apk/res/android"><item android:state_pressed="true" android:drawable="@drawable/wind_list_focused"/><item android:state_focused="true"android:state_enable="true" android:drawable="@drawable/wind_list_focused"/></selector>wind_list_focused.9.png就是一张9patch的文件了。
2). @style/CustomActonbar是自己写的style
修改/res/values/style.xml
<style name="WindCustomTitleTextColor" parent="@*android:style/TextAppearance.Holo.Widget.ActionBar.Title"><item name = "android:textColor">@*android:color/white</item></style><style name="WindCustomActionbar" parent="@*android:style/Widget.Holo.Light.ActionBar.Solid"><item name = "android:background">@drawalbe/wind_titlebar_background></item><item name = "android:titleTextStyle">@style/WindCustomTitleTextColor></item></style>
上面的两个属性是自定义ActionBar的背景色:wind_titlebar_background.png和字体颜:@*android:color/white
wind_titlebar_background.png为ActionBar的背景图片
- 自定义一个Theme
- 自定义Theme 与 使用
- android 关于自定义Theme
- 自定义主题Theme
- Android自定义Theme&style
- Android 自定义theme
- android自定义theme尝试
- org-reveal 自定义theme
- android自定义theme
- 自定义属性、Style、Theme
- 自定义Theme(1)
- theme自定义格式
- xadmin theme自定义主题
- Drupal theme 自定义region实现
- 编译自定义的主题theme
- sencha touch2 自定义样式(theme)
- android自定义theme的使用
- 自定义material theme的属性
- 在ubuntu 12.04 上将默认的gcc 4.6 改成gcc 4.4
- Flex与java通过BlazeDS实现通信(简单Demo)
- Python 导入数据到mysql
- Java 中把一个字符串反转
- Linux USB "On-The-Go"(OTG) on OMAP H2 软件架构分析(二)
- 自定义一个Theme
- javascript里的条件判断
- TFS入门使用教程--团队成员权限设置
- linux系统编程读书笔记 第五章
- Linux后台进程管理利器:supervisor
- JavaEE相关代码
- Linux USB "On-The-Go"(OTG) on OMAP H2 软件架构分析(三)
- Python学习之网页抓取(二)
- html 表单设计时对输入文本数据类型的限制