1
我可以通过以下方式获得RadioButton
组吗?Android单选按钮组
x x x
x x x
x x x
现在我得到这一切在一条线 - 垂直或水平:
x x x x x x or x
x
x
x
x
x
在水平它去下一行,但它不是在固定的位置。
下面的代码只是为了符合发布的标准。
<RadioGroup
android:id="@+id/calradioGroup4.1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:orientation="vertical" >
<RadioButton
android:id="@+id/radioNONE"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="None" />
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="0-5" />
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="11-15" />
使用三个radiogroups,一个在另一个的上面,一个RelativeLayout的。 –
但是这并不能真正解决问题,因为它硬编码到三行。我会建议动态初始化RadioGroups,然后您可以根据您拥有的数据指定行数。 – Tautvydas
呃,我刚刚使用了3组,一组旁边!不管怎么说,还是要谢谢你。 – chotu123