android xml 属性收集
2013-04-18 21:51
363 查看
集中一下看代码时遇到的一些我认为特殊的属性。
1. android:divider="?android:attr/dividerVertical"
android:showDividers="end"
android:dividerPadding="12dp"
这三个一看就是设置分割线的。意思一看就懂。
2. android:duplicateParentState="true"
设置为 true 的话,将直接从父容器中获取绘图状态(光标,按下等)。注意仅仅是获取状态,而不是事件。也就是你点击一下 LinearLayout 时 Button 有点击效果,但不执行点击事件。
3. Styles and Themes from google Document
1). A Style is a collection of properties that specify the look and format for a view or a window.
2). A Theme is a style applied to an entire activity or application,rather than an individual view. when a style is applied as a theme, every view in the activity or application will apply each style property that it supports.
3). 在 res/values 文件中创建一个 xml 文件即可定义 style,文件的名字随意。该 xml 文件的根节点必须是 <resources> 。each child of the <resources> element is converted into an application resource object at compile-time.
4). 如果一个自定义的 style B 要继承自定义的 style A ,可以不用 parent 属性,而直接将 B 命名为 A.B 即可。
5). 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.
6). if a style is applied to a viewgroup, the child view elements will not inherit the style properties, only the element to which you directly apply the style will apply its properties.
1. android:divider="?android:attr/dividerVertical"
android:showDividers="end"
android:dividerPadding="12dp"
这三个一看就是设置分割线的。意思一看就懂。
2. android:duplicateParentState="true"
设置为 true 的话,将直接从父容器中获取绘图状态(光标,按下等)。注意仅仅是获取状态,而不是事件。也就是你点击一下 LinearLayout 时 Button 有点击效果,但不执行点击事件。
3. Styles and Themes from google Document
1). A Style is a collection of properties that specify the look and format for a view or a window.
2). A Theme is a style applied to an entire activity or application,rather than an individual view. when a style is applied as a theme, every view in the activity or application will apply each style property that it supports.
3). 在 res/values 文件中创建一个 xml 文件即可定义 style,文件的名字随意。该 xml 文件的根节点必须是 <resources> 。each child of the <resources> element is converted into an application resource object at compile-time.
4). 如果一个自定义的 style B 要继承自定义的 style A ,可以不用 parent 属性,而直接将 B 命名为 A.B 即可。
5). 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.
6). if a style is applied to a viewgroup, the child view elements will not inherit the style properties, only the element to which you directly apply the style will apply its properties.
相关文章推荐
- 收集Android里xml配置属性在java代码里的实现
- android 动画 ——alpha、scale、translate、rotate、set的xml属性及用法
- AndroidMainfest.xml 中属性说明
- 关于android的animation的xml定义中的android:interpolator属性的含义
- android中通过自定义xml实现shape效果 的属性配置
- android通过style.xml文件定义相同控件的通用属性
- Android--自定义控件的xml属性
- Android自定义View中的自定义属性(attrs.xml,TypedArray的使用)
- 在AndroidManifest.xml文件中键盘和自适应的android:windowSoftInputMode属性使用 | keyboard,squeezing,layout
- Android自己定义控件而且使其能够在xml中自己定义属性
- Android布局文件layout.xml的属性详解
- Android_TextView属性XML详解
- 关于android的animation的xml定义中的android:interpolator属性的含义 『转』
- AndroidManifest.xml中常用属性及含义
- 关于android的animation的xml定义中的android:interpolator属性的含义
- android:布局参数,控件属性及各种xml的作用
- android中XML属性总结(更新中)
- Android 获取AndroidManifest.xml文件versionCode,versionName属性
- 2.Android开发---xml布局文件中的常见属性总结
- Android 中自定义控件和属性(attr.xml,declare-styleable,TypedArray)的方法和使用