Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7649465
  • 博文数量: 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 14:57:30

  文本显示组件(TextView)的功能只是显示一些基础的文字信息,而如果用户要想定义可以输入的文本组件以达到很好的人机交互操作,则只能使用编辑框:EditText完成

点击(此处)折叠或打开

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android=""
  3.     android:orientation="vertical"         ?    所有组件垂直摆放
  4.     android:layout_width="fill_parent"        ?    布局管理器宽度为屏幕宽度
  5.     android:layout_height="fill_parent">        ?    布局管理器高度为屏幕高度
  6.     <EditText                 ?    定义文本编辑框
  7.         android:id="@+id/myet1"         ?    此编辑框ID,为程序中使用
  8.         android:layout_width="fill_parent"        ?    宽度将填充整个屏幕
  9.         android:layout_height="wrap_content"     ?    高度是文字高度
  10.         android:text="北京魔乐科技软件学院(MLDN)"    ?    默认文字信息
  11.         android:selectAllOnFocus="true"/>        ?    默认选中,并设为焦点
  12.     <EditText                 ?    定义文本编辑框
  13.         android:id="@+id/myet2"         ?    此编辑框ID,为程序中使用
  14.         android:layout_width="fill_parent"        ?    宽度将填充整个屏幕
  15.         android:layout_height="wrap_content"     ?    高度是文字高度
  16.         android:text="网址:"/>    ?    默认文字信息
  17.     <EditText                 ?    定义文本编辑框
  18.         android:id="@+id/myet3"         ?    此编辑框ID,为程序中使用
  19.         android:layout_width="fill_parent"        ?    宽度将填充整个屏幕
  20.         android:layout_height="wrap_content"     ?    高度是文字高度
  21.         android:password="true"         ?    密文形式显示文本
  22.         android:text=“用户登陆密码”/>        ?    默认文字信息
  23.     <EditText                 ?    定义文本编辑框
  24.         android:id="@+id/myet4"         ?    此编辑框ID,为程序中使用
  25.         android:layout_width="fill_parent"        ?    宽度将填充整个屏幕
  26.         android:layout_height="wrap_content"     ?    高度是文字高度        
  27.         android:text="51283346"            ?    默认文字信息
  28.         android:numeric=“integer”/>            ?    只能输入数字
  29.     <EditText                 ?    定义文本编辑框
  30. </LinearLayout>

020404_编辑框:EditText.ppt
阅读(781) | 评论(0) | 转发(0) |
0

上一篇:按钮组件:Button

下一篇:单选钮:RadioGroup

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