(一)概述:
(二)RadioButton的基本用法与事件处理:
效果图:
实现代码:
xml文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:text="性别: "
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<RadioGroup android:id="@+id/sex"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton
android:text="男"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:text="女"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
<Button
and