标题Button
01 StateListDrawable
StateListDrawable是Drawable资源的一种,可以根据不同的状态,设置不同的状态,设置不同的图片效果,关键节点<selector>
,我们只需要将Button的background属性设置为该drawable资源即可轻松实现,按下按钮时不同的按钮颜色或背景
drawable
:引用的·Drawable位图state_focused
:是否获得焦点state_pressed
:控件是否被按下state_enabled
:控件是否可用state_selected
:控件是否被选择,针对有滚轮的情况state_checked
:控件是否被勾选state_checkable
:控件可否被勾选,eg:checkbox