您的位置:首页 > 移动开发 > Android开发

NOTE:Android Styles and Themes的一些需要注意的小细节

2013-10-21 12:14 423 查看
1. 继承: 在运用系统自带的风格时只想改变其中一些小的方面,当然,我们可以直接在布局文件中控件的属性里重写这个属性即可。因为在布局文件中定义的属性的优先级>我们在style中定义的属性。


若是继承自己定义的style时可以使用下面格式,继承于CodeFont.但不适用于继承系统自带的style


2. style内容:可以上Android developer查找特定类的XML attributes,还有些属性是不属于任何view,只属于window的.

However, if you apply a style to a View that does not support all of the style properties, the View will apply only those properties that are supported and simply ignore the others.

你所定义的style,并不一定适用于所有的视图,有些属性试图并不支持,这个时候,视图将只会运用它所支持的属性,忽略掉剩下的属性.

3. 应用style:

#b0b0ff


(Note that the color needs to supplied as a separate resource here because the
android:windowBackground
attribute only supports a reference to another resource; unlike
android:colorBackground
, it can not be given a color literal.)

注意到
android:windowBackground
只支持对另一资源的引用,这与
android:colorBackground
不一样.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: