免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1547 | 回复: 1

[Android] 用户友好的输入界面 [复制链接]

论坛徽章:
0
发表于 2015-07-24 14:08 |显示全部楼层
1.png
Demo2\youhao\src\main\res\layout\activity_main.xml
  1. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2.     xmlns:tools="http://schemas.android.com/tools"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="match_parent"
  5.     android:stretchColumns="1"
  6.     tools:context=".MainActivity">

  7.     <TableRow>

  8.         <TextView
  9.             android:layout_width="match_parent"
  10.             android:layout_height="wrap_content"
  11.             android:text="用户名"
  12.             android:textSize="16dp" />

  13.         <EditText
  14.             android:layout_width="match_parent"
  15.             android:layout_height="wrap_content"
  16.             android:hint="请填写登录账号"
  17.             android:selectAllOnFocus="true" />
  18.     </TableRow>

  19.     <TableRow>

  20.         <TextView
  21.             android:layout_width="match_parent"
  22.             android:layout_height="wrap_content"
  23.             android:text="密码"
  24.             android:textSize="16dp" />

  25.         <EditText
  26.             android:layout_width="match_parent"
  27.             android:layout_height="wrap_content"
  28.             android:hint="请填写登录密码"
  29.             android:inputType="numberPassword" />
  30.     </TableRow>

  31.     <TableRow>

  32.         <TextView
  33.             android:layout_width="match_parent"
  34.             android:layout_height="wrap_content"
  35.             android:text="年龄"
  36.             android:textSize="16dp" />

  37.         <EditText
  38.             android:layout_width="match_parent"
  39.             android:layout_height="wrap_content"
  40.             android:hint="请填写年龄"
  41.             android:inputType="number" />
  42.     </TableRow>

  43.     <TableRow>

  44.         <TextView
  45.             android:layout_width="match_parent"
  46.             android:layout_height="wrap_content"
  47.             android:text="生日"
  48.             android:textSize="16dp" />

  49.         <EditText
  50.             android:layout_width="match_parent"
  51.             android:layout_height="wrap_content"
  52.             android:hint="请填写生日"
  53.             android:inputType="date" />
  54.     </TableRow>

  55.     <TableRow>

  56.         <TextView
  57.             android:layout_width="match_parent"
  58.             android:layout_height="wrap_content"
  59.             android:text="电话号码"
  60.             android:textSize="16dp" />

  61.         <EditText
  62.             android:layout_width="match_parent"
  63.             android:layout_height="wrap_content"
  64.             android:hint="请填写电话号码"
  65.             android:inputType="phone"
  66.             android:selectAllOnFocus="true" />
  67.     </TableRow>

  68.     <Button
  69.         android:layout_width="wrap_content"
  70.         android:layout_height="wrap_content"
  71.         android:text="注册
  72.         " />
  73. </TableLayout>
复制代码

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
发表于 2015-08-11 15:41 |显示全部楼层
布局问题。美工做。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP