您的位置:首页 > 移动开发 > Android开发

android 控件 单项选择(RadioGroup,RadioButton)

2014-05-27 21:22 776 查看
1、继承关系和子类:





2、定义:

RadioButton表示单个圆形单选框,而RadioGroup是可以容纳多个RadioButton的容器

3、XML重要属性:

4、重要方法:

5、实战:
布局文件 

<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<RadioButton

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="男" />

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="女" />

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="不確定" />
</RadioGroup>
参考1:http://developer.android.com/intl/zh-cn/reference/android/widget/RadioButton.html

参考2:http://www.cnblogs.com/wt616/archive/2011/06/20/2085531.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: