Blog: Http://blog.csdn.net/muyang_ren
When the button changes color, the response color of the button is changed, and if the button color is set in the form below, the button responds with no color changes.
<Button......android:background="#669966"/>
Buttons have response color to be changed:
1
<Button......android:background="@drawable/star_button_select"/>
2. Create a new Star_button_select.xml file under the drawable file with the following content
<?xml version= "1.0" encoding= "Utf-8"? <selector Xmlns:android =; Span class= "Hljs-tag" ><item android:drawable = "@color/clr_normal" android:state_pressed =/> < item android:drawable = "@color/clr_pressed" android:state_pressed = "true" /> </selector ;
3. Modify the Color.xml in the Res/values directory (no new one)
<resources> <color name="clr_normal">#ff6eff2d</color> <color name="clr_pressed">#669966</color></resources>
Android Learning "button Color modification"