下载此文档

Android控件.doc


文档分类:办公文档 | 页数:约7页 举报非法文档有奖
1/7
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/7 下载此文档
文档列表 文档介绍
Android 控件(注册对话框) 收藏
Android 控件(注册对话框)
--学6(金海建)
目的:学习设计一个注册界面,来学习RadioGroup、RadioButton、Spinner、DatePicker、TimePicker这些控件的使用。
RadioGroup和RadioButton
一般情况下,我们会把某一组RadioButton做成一个单选。这种情况下,我们需要把RadioButton和RadioGroup结合使用。在布局的时候,需要把RadioButton作为RadioGroup的子控件。
新建一个工程,设计如下UI。
性别选择的布局文件
<LinearLayout android:id="@+id/LinearLayout02" android:layout_height="wrap_content" android:layout_width="match_parent"><TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/sex" android:text="***@string/sex" android:layout_marginTop="10px"></TextView>
<RadioGroup android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal" android:id="@+id/sexselect">
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/RadioMan" android:text="***@string/man" android:layout_marginLeft="10px"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="***@string/women" android:layout_marginLeft="20px" android:id="@+id/Radiowomen"></RadioButton>
</RadioGroup>
</LinearLayout> 
在用户点击了某个单选框之后,对事件进行处理。
import ;
import ;
import ;
public class UserReg extends Activity
{
RadioGroup m_sexselectGroup;
/** Called when the activity is first created.

Android控件 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数7
  • 收藏数0 收藏
  • 顶次数0
  • 上传人mh900965
  • 文件大小132 KB
  • 时间2018-04-20