Android复选框(CheckBox)的现实
Android复选框(CheckBox)的现实。
新建一个Android项目,在main.xml中输入如下代码,然后运行即可。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/info"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25px"
android:layout_marginTop="10px"
android:text="您经常浏览的网站是什么?" />
<CheckBox
android:id="@+id/url1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25px"
android:checked="true"
android:text="www.hao123.com"/>
<CheckBox
android:id="@+id/url2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25px"
android:text="www.baidu.com"/>
<CheckBox
android:id="@+id/url3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25px"
android:text="www.liyewen.com"/>
</LinearLayout>
更多相关文章
- android典型代码系列(二十二)------按键使上面的EditText抖动
- 用代码创建Android视图
- Android中对Group的各种操作示例代码
- Android 获取时间实例代码
- android 源代码 获得 Open Soure Project
- android 实现流媒体播放远程mp3文件代码
- Android 代码中实现返回键功能
- Android的jni下c与java数据互传测试代码