RadioButton android:id="@+id/tank_warning_setting_2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/dp_100" android:background="@drawable/radiobutton_background" android:button="@null"
android:id="@+id/tank_warning_setting_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_100"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:text="选项2"
android:textColor="@drawable/radiobutton_textcolor"
android:textSize="@dimen/sp_40" />
radiobutton_background
<item android:drawable="@drawable/radiobutton_background_unchecked" android:state_checked="false" />
<item android:drawable="@drawable/radiobutton_background_checked" android:state_checked="true" />
</selector>
radiobutton_background_unchecked
android:shape="rectangle">
<!-- 背景填充 -->
<solid android:color="@color/white" />
<!-- 圆角 -->
<corners android:radius="5dp" />
<stroke
android:width="5dp"
android:color="@color/color_text_gray" /><!-- 描边,边框宽度、颜色 -->
</shape>
radiobutton_background_checked
android:shape="rectangle">
<!-- 填充 -->
<solid android:color="#f59a23" />
<!-- 圆角 -->
<corners android:radius="5dp" />
<stroke
android:width="5dp"
android:color="@color/color_text_gray" /><!-- 描边,边框宽度、颜色 -->
</shape>
radiobutton_textcolor
<item android:color="@color/color_text_gray" android:state_checked="false" />
<item android:color="@color/white" android:state_checked="true" />
</selector>