Android 按钮按下效果
<?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/bus_s" />
<item android:state_pressed="false" android:state_focused="false"
android:drawable="@drawable/bus_u" />
<item android:state_focused="true" android:drawable="@drawable/bus_s" />
<item android:state_focused="false" android:drawable="@drawable/bus_u" />
<item android:state_checked="true" android:drawable="@drawable/bus_s"></item>
</selector>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" android:drawable="@drawable/bus_s" />
<item android:state_pressed="false" android:state_focused="false"
android:drawable="@drawable/bus_u" />
<item android:state_focused="true" android:drawable="@drawable/bus_s" />
<item android:state_focused="false" android:drawable="@drawable/bus_u" />
<item android:state_checked="true" android:drawable="@drawable/bus_s"></item>
</selector>
13 14 2./res/layout/team_unit_view.xml 15 <?xml version="1.0" encoding="utf-8"?> 16 <Button 17 android:layout_width="400dp" 18 android:layout_height="135dp" 19 android:background="@drawable/selector" 20 android:orientation="horizontal" > 21 </button>