改变默认RadioButton的样式,结合<shape></shape> 和<selector ></selector>自定义drawable,通过设置android:button="@null" android:background="@drawable/bg_test或者android:button="@drawable/bg_front_size_12sp"
<RadioGroup
android:id="@+id/lrc_frontSize"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal">
//1.自定义drawable,直接设置android:button=" "
<RadioButton
android:id="@+id/a12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginRight="@dimen/dp_18"
android:button="@drawable/bg_front_size_12sp" />
//2.自定义drawable,设置android:button="@null " 然后设置 android:background=""
<RadioButton
android:id="@+id/a12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginRight="@dimen/dp_18"
android:background="@drawable/bg_test
android:button="@null"/>
</RadioGroup>
</LinearLayout>