android表格布局做登录注册,Android使用表格布局设计注册界面

本文介绍了如何在Android中使用表格布局(TableLayout)设计一个简单的用户注册界面,包括用户名、密码、确认密码和验证码输入字段。代码示例展示了XML布局和Java代码,其中验证码通过自定义的CodeUtils工具类生成。
摘要由CSDN通过智能技术生成

Android中使用表格布局设计注册界面,供大家参考,具体内容如下

注册页面包含:用户名,密码,确认密码,验证码。验证码使用一个封装好的工具类生成的,可以直接使用。效果图如下所示。没有做事件处理,仅仅做了个简单的表格布局。

6d7c8f1b4ec07182be8ed1b65bd032c8.png

XML布局的代码如下:

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:stretchColumns="1"

tools:context="com.example.nuist__njupt.register.MainActivity">

android:id="@+id/register_title"

android:layout_height="wrap_content"

android:layout_width="wrap_content"

android:text="用户注册"

android:textSize="20dp"

android:gravity="center_horizontal"

android:textColor="@android:color/black"

android:layout_marginTop="5dp"

/>

android:id="@+id/user_name"

android:text="用户名"

android:textSize="15dp"

android:layout_marginLeft="5dp"

android:layout_marginTop="20dp"

android:textColor="@android:color/black"

/>

android:layout_width="match_parent"

android:id="@+id/input_name"

android:hint="请输入用户名"

android:textSize="15dp"

android:layout_marginTop="20dp"

android:selectAllOnFocus="true"

android:layout_span="2"

/>

android:id="@+id/user_password"

android:text="密码"

android:textSize="15dp"

android:layout_marginLeft="5dp"

android:textColor="@android:color/black"

/>

android:layout_width="match_parent"

android:id="@

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值