android - Image button focus isn't working -
i'm brand-new android, , i've been trying make image button 3 images, default, focused, , pressed. i've tried lot of examples i've found, can't seem make button respond focus.
i found following example on forum, , displays button, , responds being pressed, doesn't change on focus. can tell me why?
are using selectors changing drawable behind button? example, did use android:src="@drawable/selector1
. selector code button should (more description here):
<?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/but1_pressed" /> <item android:state_focused="true" android:drawable="@drawable/but1_focused" /> <item android:drawable="@drawable/but1_default" /> </selector>
Comments
Post a Comment