这是给你的一些代码..你可以做这样的事情。如果您有任何问题,那么我可以将整个项目邮寄给您。希望这对您和其他人有所帮助。!!
res/drawable/red_ring.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadiusRatio="3"
android:shape="ring"
android:thickness="10dp"
android:useLevel="false" >
<solid android:color="#FF0000" />
<size
android:height="30dp"
android:width="30dp" />
</shape>
res/drawable/blue_ring.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadiusRatio="3"
android:shape="ring"
android:thickness="5dp"
android:useLevel="false" >
<solid android:color="#0000FF" />
<size
android:height="20dp"
android:width="20dp" />
</shape>
res/drawable/layer.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/red_ring"/>
<item android:drawable="@drawable/blue_ring"/>
</layer-list>
res/drawable/selector_radio.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true" android:drawable="@drawable/layer"></item>
<item android:drawable="@drawable/blue_ring"></item>
</selector>
资源/布局/activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:gravity="center" >
<RadioButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:button="@drawable/selector_radio"
android:paddingLeft="30dp"
android:text="Radio 1" />
<RadioButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:button="@drawable/selector_radio"
android:paddingLeft="30dp"
android:text="Radio 2" />
</RadioGroup>
</RelativeLayout>
截屏: