Android的永RadioButton的相关mucchin



如何部署一组(单选按钮)多个单选按钮


我要放置一组(单选按钮)多个单选按钮,可以怎么办?

Android应用程序,申请表格及网站的PC相比,屏幕小。
所以,这样的事情,把单选按钮选择A的组合,无论是B,一个单选按钮的组合选择的C,D或者可能没有那么多。
我应该使用让微调···。
我想。
但是,有时可能当你打电话,你想在RadioButton的绝对执行。
所以,我会告诉你如何放置了多个RadioButton的组合。


除了在它前面。
第一,我在Android中,有没有下拉菜单? 被认为。
因为当时没有感觉,查看名称“下拉”或“组合框”的原因。
没办法,被命名为微调·。
Android的初学者,我不知道,但存在微调,我们考虑使用RadioButton。
所以,这篇文章是我自己的方式在当时的信息进行了调查。


说进行了审查,
XML布局到Android,我注意到,当您添加的RadioButton。
下面是一个窗口,当你添加到XML视图的布局。
如何部署一组(单选按钮)多个单选按钮
请看看在红色框架的一部分。
有ViewGroup的命名,确实。
“RadioGroup中连它的名字。”
使用正确的家伙。
这RadioGroup中,以及诸如ViewGroup的LinearLayout中,可以有一个子元素的视图。
正如附近开始,如果你想放置的单选按钮选择为B,A的组合,组合的单选按钮,选择C,要么ð如下:如果确定。




将作如下安排:在XML布局。
<RadioGroup Android:id="@+id/RadioGroup01" android:layout_width="wrap_content" android:layout_height="wrap_content">
<RadioButton Android:id="@+id/RadioButton01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="A"> </ RadioButton的>
<RadioButton Android:id="@+id/RadioButton02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="B"> </ RadioButton的>
</ RadioGroup中>
<RadioGroup Android:id="@+id/RadioGroup02" android:layout_width="wrap_content" android:layout_height="wrap_content">
<RadioButton Android:id="@+id/RadioButton03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="C"> </ RadioButton的>
<RadioButton Android:id="@+id/RadioButton04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="D"> </ RadioButton的>
</ RadioGroup中>


窗口看到和感受到大纲Android用于Eclipse的布局编辑器如下。 使之成为一个红色的框,它是确定的,如果添加了查看。
如何部署一组(单选按钮)多个单选按钮


和这个工作,如下:给你一个选择,从每个C A,B,D
如何部署一组(单选按钮)多个单选按钮