单选框 (RadioButton)和复选框 (CheckBox)都可以额外的指定一个android:Checked属性,用来指定是否被选中.
RadioButton可以用RadioGroup包裹起来,用来组建一组单选按钮呢
XML代码
<RadioGroup
android:id="@+id/radiogroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/checkbox3" >
<RadioButton
android:id="@+id/radiobutton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="帅哥" />
<RadioButton
android:id="@+id/radiobutton2"
android:layout_width="wrap_content"
android:layout_height="