I have a button and I want it to have different background when I set:
android:enabled="false"
Here's resource file for background:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false"
android:drawable="@drawable/bttn_orange_normal" /> <!-- pressed -->
<item android:state_pressed="true"
android:drawable="@drawable/bttn_orange_selected" /> <!-- focused -->
<item android:state_enabled="false" android:drawable="@drawable/bttn_grey_disabled"/>
<item android:state_enabled="true" android:drawable="@drawable/bttn_orange_normal"/>
</selector>
But button still has normal background when it is disabled.
What am I missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…