Xml 文件作用类型:放到drawable文件夹内
Button,CheckBox,ImageView ,TextView ,Layout的selector 设置
对于Button,设置background
对于ImageView 设置src,setImageResource
对于CheckBox 设置 background
android:background="@drawable/checkbox_my_recording"
或者 设置 style
style="@style/sensor_lock_checkbox"
在style 内指定对应的selector xml 文件
对于TextView,设置 textColor
android:textColor="@drawable/mainfrag_tabhost_txt_style"
对于Layout,设置 background
state_pressed
state_focused
state_selected
state_enabled
和正常状态
动画
animation-list
根标签为animation-list,其中oneshot代表着是否只展示一遍,设置为false会不停的循环播放动画
根标签下,通过item标签对动画中的每一个图片进行声明
android:duration 表示展示所用的该图片的时间长度
Shape
<solid android:color= "#fafff1" />
<stroke
android:width= "1dp"
android:color= "#83db00" />
<corners
android:radius="1dp" />
通过background 设置,设置给layout,对话框
android:background="@drawable/dialog_activity_bg"
定义 corner
layer-list
进度条样式
android:progressDrawable="@drawable/download_progressbar"
download_progressbar.xml
RatingBar
android:progressDrawable="@drawable/popup_ratingbar_config_small"
popup_ratingbar_config_small.xml
rotate
旋转
pull_refresh_process_bar.xml
光标样式
edit_cusor_style.xml
EditText中设置
android:textCursorDrawable="@drawable/edit_cusor_style"
ListView 选中项样式,自定义Item 的布局,在该布局xml 中设置background
livetv_channel_item_selector.xml
宽度,高度设置在dimen文件中
android:layout_width="@dimen/corner_width" android:layout_height="@dimen/corner_height"
<dimen name="corner_width">55dp</dimen> <dimen name="corner_height">20dp</dimen>