在需要用户输入数据的时候,友好的界面是非常重要的,所以如果我们能在输入框给用户一些提示,将能很好的提高程序的易用性,android就给我们提供了这样一个属性,也就是android:hint。

另外这个程序的textview里面使用一下android中的shape属性,可以参见我前一篇转载的博客。

<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><TableRow><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="用户名:"android:textSize="10sp"android:background="@drawable/bg_border"/><EditText android:layout_width="fill_parent"android:layout_height="wrap_content"android:hint="请填写登录帐号"android:selectAllOnFocus="true"/></TableRow><TableRow><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="密码:"android:textSize="10pt"android:background="@drawable/bg_border"/><EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:password="true"/></TableRow><TableRow><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="电话号码:"android:textSize="10pt"android:background="@drawable/bg_border"/><EditTextandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:hint="请填写您的电话号码"android:selectAllOnFocus="true"android:phoneNumber="true"/></TableRow><Button android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="注册"/></TableLayout>

使用的shape文件

<?xml version="1.0" encoding="UTF-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#000000"/><stroke android:width="2dip" android:color="#ff0000" /></shape>


更多相关文章

  1. Android核心分析之二十一Android应用框架之AndroidApplication
  2. android之Intent基本使用
  3. android 应用程序Activity之间数据传递与共享的几种途径
  4. Android——UI篇:RecyclerView设置点击效果无效的解决办法和item
  5. Android(安卓)WebView的加载超时处理
  6. AndroidManifest.xml文件剖析
  7. 安卓开发到底是什么
  8. 译:Android的一些基础问题(一)
  9. Android(安卓)init.c简析

随机推荐

  1. 关于Android短信管理
  2. Android启动脚本init.rc
  3. 【Android】20.0 第20章 音频、视频、拍
  4. Android(安卓)Makefile分析
  5. Android开发者必须深入学习的10个应用开
  6. android 2d物理引擎-Box2d
  7. Android(安卓)实用工具Hierarchy Viewer
  8. Android的布局和Intent笔记和常用实例
  9. Android(安卓)启动过程详解
  10. 【Based Android】PreferenceActivity设