我想创建一个像下面这样简单的布局:
我已经创建了以下layout.xml文件进行布局:
(o) Radio button A
(o) Radio button B [textedit]
[x] checkbox
我已经创建了以下layout.xml文件进行布局:
<RadioGroup
android:layout_above="@+id/RadioButton_Count"
android:id="@+id/RadioGroup01"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<RadioButton
android:layout_height="wrap_content"
android:id="@+id/RadioButton_A"
android:text="Play forever"
android:checked="true"
android:layout_width="fill_parent"
android:textSize="20sp">
</RadioButton>
<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/RadioButton_B"
android:text="Count:"
android:textSize="20sp">
</RadioButton>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/EditText_NumCount"
android:inputType="number"
android:layout_toRightOf="@+id/RadioButton_B"
android:width="70sp" >
</EditText>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/CheckBox_StopCount"
android:text="Stop"
android:layout_below="@+id/RadioButton_B"
android:textSize="18sp">
</CheckBox>
</RelativeLayout>
</RadioGroup>
看起来没问题,但问题是单选按钮之间没有连接,我的意思是它们可以同时被选中。
我认为这是因为即使它们都挂在同一个 <form>
下,第二个单选按钮也在另一个布局内:\
有人有什么想法如何制作这种布局(主要是 [textedit] 紧贴 RadioButton B),使单选按钮也能正常工作?
非常感谢