1.实现radioButton drawable selector更改图片,在drawable文件夹下,新建selector文件,
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/wo_unfocus" /> <item android:state_enabled="true" android:state_pressed="true" android:drawable="@drawable/wo_focus" /> <item android:state_enabled="true" android:state_checked="true" android:drawable="@drawable/wo_focus" /> <item android:drawable="@drawable/wo_unfocus"/> </selector>
2.实现radiobutton text 的颜色更改,在res下,新建color文件夹,然后新建selector
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="false" android:color="@color/fontSomberbess"/> <item android:state_checked="true" android:color="@color/fontRoseo"/> </selector>
3.radiobutton 去掉小圆圈
android:button="@null"