titlebar_btn_refresh_selector.xml
<?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/titlebar_button_refresh_selected"/>
<item
android:state_focused="true"
android:drawable="@drawable/titlebar_button_refresh_selected"/>
<item
android:drawable="@drawable/titlebar_button_refresh"/>
</selector>
一共三種狀態:按下、聚焦、不然(也就是除了前面兩種狀態)
而後在button的android:background=「」上引用這個xml文件