开发者

custom button images not applying

Hi im applying开发者_如何学编程 custom images to button on different states, for which i create an xml file in appliication drawable folder in which i define states of button and images like this

Btn_enter_cutom.xml

<item android:drawable="@drawable/btn_enter" />   
<item 
    android:state_pressed="true" 
    android:drawable="@drawable/btn_enter_pressed" />   

and assign this xml file to background attribute of the button. button's default image is btn_enter.png but when this button presses i want to apply btn_enter_presses.png,but when i pressed the button nothing will happens,is there any problem with the xml file please help me in this regards.thanks


A state list will always display the first matching line. Reverse your two items, since the first one acts as a default and prevents any further testing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜