4.EditText控件的应用实例:结合TableLayout
来源:互联网 发布:linux常用命令 cat 编辑:程序博客网 时间:2024/06/16 21:27
目标效果:
为了使应用程序布局显示不杂乱,添加了一个TableLayout表格布局文件管理器,其中页面的每一行是使用TableRow 来装控件。
其中,整个文件是采用TableLayout表格布局器布局,对于界面中要显示的每一行,采用TableRow将该行的所有控件包含起来,在这里是两个控件一组,最后的一行是两个按钮,采用嵌套的线性布局实现。
布局实现:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/TableLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:text="用户名" android:textSize="20dp" /> <EditText android:hint="请输入用户名" android:textSize="20dp" android:inputType="textPersonName"/> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:text="密 码" android:textSize="20dp" /> <EditText android:hint="请输入密码" android:textSize="20dp" android:password="true" /> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:text="确认密码" android:textSize="20dp" /> <EditText android:hint="请输入密码" android:textSize="20dp" android:inputType="textPassword"/> </TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:text="电话号码" android:textSize="20dp" /> <EditText android:hint="请输入电话号码" android:textSize="20dp" android:inputType="phone" /></TableRow> <TableRow android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:text="邮箱地址" android:textSize="20dp" /> <EditText android:hint="请输入邮箱地址" android:textSize="20dp" android:inputType="textEmailAddress" /> </TableRow> <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:text="注册" android:textSize="20dp" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <Button android:text="重置" android:textSize="20dp" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout></TableLayout>
阅读全文
0 0
- 4.EditText控件的应用实例:结合TableLayout
- 实现editText控件和ImageButton控件的结合
- TableLayout里的EditText,会自动下移!
- Button,ImageButton,EditText三控件的应用。
- TableLayout与ToolBar的完美结合?
- spring结合velocity的应用实例
- UI控件----EditText 实例总结
- Android EditText TextWatcher应用实例
- TableLayout与ViewPager的简单应用
- EditText控件的使用
- EditText控件的使用
- EditText控件的使用
- EditText控件的使用
- EditText控件的学习
- Tab控件的一个简单应用实例
- 11.计时器Chronometer控件的应用实例
- EditText:带清空功能的EditText控件
- TableLayout使用实例
- 【Python-2.7】大小写转换函数
- 第三周项目1-顺序表的基本算法
- BufferedOutputStream 源码的个人理解
- pachi源码阅读
- OWASP 10大安全问题
- 4.EditText控件的应用实例:结合TableLayout
- Linux IO模式及 select、poll、epoll详解
- java获取excel指定行内容
- C#回顾学习笔记十一:while循环语句
- spring scope prototype与singleton区别
- python 调用 C/C++
- js增删改查列表
- 关于查询两种张表两列和并求两列和的和
- centOS7.2快速安装mysql