首页 新闻 赞助 找找看

android RadioGroup

0
悬赏园豆:10 [待解决问题]

一下代码运行正常,只能选其中一个RadioButton。

<RadioGroup
android:layout_width="fill_parent"
android:layout_height
="wrap_content" >

<RadioButton
android:id="@+id/r1"
android:layout_width
="wrap_content"
android:layout_height
="wrap_content"
android:checked
="true" />

<RadioButton
android:id="@+id/r2"
android:layout_width
="wrap_content"
android:layout_height
="wrap_content" />
</RadioGroup>

去掉中间两个RadioButton的id后,两个RadioButton可以同时选中。 何解?不加id就说明不在一组?

sirYoung的主页 sirYoung | 初学一级 | 园豆:190
提问于:2012-02-13 13:58
< >
分享
所有回答(2)
0

没试验过,多选用CHECKBOX,这个是单选的。你选中后肯定要处理的带上ID呗

兼职程序员 | 园豆:213 (菜鸟二级) | 2012-03-23 15:00
0

设置id后才能说明他们是隶属于GadioGroup之中的

如溪 | 园豆:202 (菜鸟二级) | 2012-06-15 20:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册