正確的姿勢:
-
<?xml version="1.0" encoding="utf-8"?>
-
<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
<!--
-
android:state_enabled="true" 不能省,否則disable狀態會無效
-
-->
-
<item android:state_enabled="true" android:state_pressed="true" android:drawable="@drawable/btn_chat_pressed" />
-
<item android:state_enabled="true" android:drawable="@drawable/btn_chat_normal" />
-
<item android:state_enabled="false" android:drawable="@drawable/btn_chat_disable"/>
-
</selector>
----EOF----