Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7563396
  • 博文数量: 961
  • 博客积分: 15795
  • 博客等级: 上将
  • 技术积分: 16612
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-07 14:23
文章分类

全部博文(961)

文章存档

2016年(1)

2015年(61)

2014年(41)

2013年(51)

2012年(235)

2011年(391)

2010年(181)

分类: Android平台

2015-11-17 15:37:38

    CheckBox的主要功能是完成复选框的操作,在用户输入信息的时候,可以一次性选择多个内容,例如:用户在选择个人兴趣爱好的时候一定会存在多个,则此时就直接使用CheckBox即可完成功能

点击(此处)折叠或打开

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout                 ?    定义线型布局管理器
  3.     xmlns:android=""
  4.     android:orientation="vertical"         ?    所有组件垂直摆放
  5.     android:layout_width="fill_parent"        ?    布局管理器宽度为屏幕宽度
  6.     android:layout_height="fill_parent">        ?    布局管理器高度为屏幕高度
  7.     <TextView                ?    定义文本显示组件
  8.         android:id="@+id/info"            ?    此组件的ID,程序中使用
  9.         android:text="您经常浏览的网站是:"        ?    显示的文本信息
  10.         android:textSize="20px"            ?    文字大小为20像素
  11.         android:layout_width="fill_parent"        ?    文本显示组件宽度为屏幕宽度
  12.         android:layout_height="wrap_content" />    ?    文本显示组件高度为文字高度
  13.     <CheckBox                ?    定义复选框
  14.         android:id="@+id/url1"            ?    此组件ID,程序中使用
  15.         android:text=""        ?    组件的显示文字
  16.         android:layout_width="fill_parent"        ?    组件的宽度为屏幕宽度
  17.         android:layout_height="wrap_content" />    ?    组件的高度为文字高度
  18.     <CheckBox                ?    定义复选框
  19.         android:id="@+id/url2"            ?    此组件ID,程序中使用
  20.         android:text="bbs.mldn.cn"        ?    组件的显示文字
  21.         android:layout_width="fill_parent"        ?    组件的宽度为屏幕宽度
  22.         android:layout_height="wrap_content"    ?    组件的高度为文字高度
  23.         android:checked="true" />        ?    设置为默认选中
  24.     <CheckBox                ?    定义复选框
  25.         android:id="@+id/url3"            ?    此组件ID,程序中使用
  26.         android:layout_width="fill_parent"        ?    组件的宽度为屏幕宽度
  27.         android:layout_height="wrap_content" />    ?    组件的高度为文字高度
  28. </LinearLayout>

020406_复选框.ppt
阅读(906) | 评论(0) | 转发(0) |
0

上一篇:单选钮:RadioGroup

下一篇:下拉列表框

给主人留下些什么吧!~~