有人可以告诉我如何创建一个带有单选按钮的 radioGroup,该按钮看起来像图像上的样子:
这是我的xml代码:
<RadioGroup
android:id="@+id/network_creation_radiogroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="20dp">
<RadioButton
android:id="@+id/network_creation_private"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="false"
android:drawableRight="@drawable/lock"
android:text="Private"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
style="@style/TextView_LightGrey"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Anyone can join" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="@color/dark_gray" />
<RadioButton
android:id="@+id/network_creation_public"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:drawableRight="@drawable/unlock"
android:text="Public"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
style="@style/TextView_LightGrey"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Join via a suggest from existing\nnetwork members" />
</RadioGroup>