使用XML实现按钮改变焦点设置背景图,获得焦点时,获得焦点并按下,失去焦点时,默认时...
新建res/drawable/button.xml
<?xml version="1.0" encoding="utf-8"?><selector xmlns:android="http://schemas.android.com/apk/res/android"><!-- 获得焦点时 --><itemandroid:state_focused="true"android:state_pressed="false"android:drawable="@drawable/focusimage"/><!-- 获得焦点并按下 --><itemandroid:state_focused=