两种原因,
1,xml文件不能和图片名称相同。
2,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/btn_focus_press"/>
<item android:state_focused="true" android:drawable="@drawable/btn_focus_press"/>
<item android:state_selected="true" android:drawable="@drawable/btn_has_focus"/>
<span style="background-color: rgb(255, 0, 0);"> <item android:drawable="@drawable/btn_focus"/></span>
</selector>