首页 > 其他 > 详细

基本控件学习以( RadioGroup和RadioButton 的学习使用)

时间:2014-12-06 18:11:05      阅读:272      评论:0      收藏:0      [点我收藏+]

单选框学习:

XML文件部分代码:

<RadioGroup android:id="@+id/radGSex"
    android:layout_width="200dp" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"
    android:checkedButton="@+id/radMale">
    <RadioButton android:id="@+id/radMale"
        android:textSize="20sp"
        android:text="@string/male"
        />
    <RadioButton android:id="@+id/radFemale"
         android:textSize="20sp"
        android:text="@string/female"
        />
</RadioGroup>

string.xml中设计到的文件是:

<string name="male">男生</string>
<string name="female">女生</string>

  获取选项结果的代码:

private RadioGroup radGSex = (RadioGroup)findViewById(R.id.radGSex);

 

以上代码  《婚姻转换简单的将代码》

基本控件学习以( RadioGroup和RadioButton 的学习使用)

原文:http://www.cnblogs.com/zhoujn/p/4148468.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!