I have a left frame assigned to a button, as well as a background feature. I want to set the selector so that when the user presses / focuses / disables the button, its appearance changes. The image I use for left-handed painting is red "x".
I would like this to be replaced by a gray βXβ when the button is pressed or disabled. Is this possible with a selector?
Here is what I tried (which works for border / background image, but not for left-drawing (obviously).
<?xml version="1.0" encoding="utf-8" ?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:drawable="@drawable/GrayBorder" android:drawableLeft="@drawable/GrayRemove"/> <item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/GrayBorder" android:drawableLeft="@drawable/GrayRemove" /> <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/GrayBorder" android:drawableLeft="@drawable/GrayRemove" /> <item android:state_enabled="true" android:drawable="@drawable/BlackBorder" android:drawableLeft="@drawable/Remove"/> </selector>
android android-layout
theMothaShip
source share