准备2张图片用于替换选中和未选中时的样式
drawable下准备两个对应的layer-list
btn_radio_on.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="22dp"
android:height="22dp"
android:drawable="@drawable/btn_radio_on_holo_light"/>
</layer-list>
btn_radio_off.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="22dp"
android:height="22dp"
android:drawable="@drawable/btn_radio_off_holo_light"/>
</layer-list>
建立一个Selector用于按钮样式切换
selector_btn_radio.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/btn_radio_on"/>
<item android:drawable="@drawable/btn_radio_off"/>
</selector>
android:button="@drawable/selector_btn_radio"