标签:uid button round state pre lis div encoding XML
在选中和未选中的过程中,切换展示图片
http://wear.techbrood.com/guide/practices/screens_support.html
AppResource--->Resource Types----->Drawable---->StateList
selector放置的路径res/drawable/button.xml:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/button_pressed" /> <!-- 选中按钮图片 --> <item android:state_focused="true" android:drawable="@drawable/button_focused" /> <!-- 按钮获取焦点图片 --> <item android:state_hovered="true" android:drawable="@drawable/button_focused" /> <!-- 平板电视,悬浮选中某个应用图片 --> <item android:drawable="@drawable/button_normal" /> <!-- 默认图片--> </selector>
<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:background="@drawable/button" />
标签:uid button round state pre lis div encoding XML
原文地址:http://www.cnblogs.com/xufengyuan/p/6245119.html