效果图
控件
android:divider="@drawable/wosim_rg_divider"
android:showDividers="middle"
android:background="@drawable/wosim_rg_bg"
android:id="@+id/wosim_traffic_enjoy_package_rg"
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal">
android:id="@+id/wosim_traffic_enjoy_package_unicom_rb"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/wosim_selector_rb_left"
android:button="@null"
android:checked="true"
android:gravity="center"
android:text="@string/wosim_china_unicom"
android:textColor="@drawable/wosim_selector_rb_text_color"
android:textSize="13sp"/>
android:id="@+id/wosim_traffic_enjoy_package_telecom_rb"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/wosim_selector_rb_middle"
android:button="@null"
android:gravity="center"
android:text="@string/wosim_china_telecom"
android:textColor="@drawable/wosim_selector_rb_text_color"
android:textSize="13sp"/>
android:id="@+id/wosim_traffic_enjoy_package_mobile_rb"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/wosim_selector_rb_right"
android:button="@null"
android:gravity="center"
android:text="@string/wosim_china_mobile"
android:textColor="@drawable/wosim_selector_rb_text_color"
android:textSize="13sp"/>
样式
rb_left_selected.xml
android:shape="rectangle">
android:bottomLeftRadius="4dp"
android:topLeftRadius="4dp"/>
rb_middle_selected.xml
android:shape="rectangle">
rb_right_selected.xml
android:shape="rectangle">
android:bottomRightRadius="4dp"
android:topRightRadius="4dp"/>
rg_bg.xml
android:shape="rectangle">
android:width="0.5dp"
android:color="#ff71a8f4"/>
rg_divider.xml
android:shape="rectangle">
selector_rb_left.xml
selector_rb_middle.xml
selector_rb_right.xml
selector_rb_text_color.xml