注册界面设计及实现之(一)注册界面的开发实现

开发步骤: 

  • 在布局文件中设置视图组件 
  • 创建视图优化xml文件并绑定组件 
  • 添加按钮单击事件并实现验证机制

布局组件结构的设计分析:

 1 <RelativeLayout 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" android:paddingLeft="16dp"
 5     android:paddingRight="16dp"
 6     android:paddingTop="16dp"
 7     android:paddingBottom="16dp" tools:context=".Register_Activity"
 8     android:background="@drawable/bg">
 9     <LinearLayout
10         android:orientation="vertical"
11         android:layout_width="fill_parent"
12         android:layout_height="wrap_content"
13         android:background="@drawable/login_border_bg"
14         android:padding="10dp">
15         <TableLayout
16             android:layout_width="fill_parent"
17             android:layout_height="wrap_content"
18             android:collapseColumns="2"
19             android:stretchColumns="1">
20             <TableRow
21                 android:layout_width="fill_parent"
22                 android:layout_height="wrap_content">
23                 <TextView
24                     android:layout_width="wrap_content"
25                     android:layout_height="wrap_content"
26                     android:text="注册帐号:"
27                     android:textSize="15sp"
28                     android:textColor="#000000"/>
29                 <EditText
30                     android:id="@+id/txtRegAccount"
31                     android:layout_width="fill_parent"
32                     android:layout_height="35dp"
33                     android:hint="请输入注册帐号:"
34                     android:textSize="12sp"
35                     android:textColor="#000000"
36                     android:background="@drawable/txt_bg"
37                     android:paddingLeft="10dp"/>
38             </TableRow>
39             <TableRow
40                 android:layout_width="fill_parent"
41                 android:layout_height="wrap_content">
42                 <TextView
43                     android:layout_width="wrap_content"
44                     android:layout_height="wrap_content"
45                     android:text="登录密码:"
46                     android:textSize="15sp"
47                     android:textColor="#000000"/>
48                 <EditText
49                     android:id="@+id/txtRegPassword"
50                     android:layout_width="fill_parent"
51                     android:layout_height="35dp"
52                     android:hint="请输入登录密码:"
53                     android:textSize="12sp"
54                     android:textColor="#000000"
55                     android:inputType="textPassword"
56                     android:background="@drawable/txt_bg"
57                     android:paddingLeft="10dp"
58                     android:layout_marginTop="10dp"/>
59             </TableRow>
60             <TableRow
61                 android:layout_width="fill_parent"
62                 android:layout_height="wrap_content">
63                 <TextView
64                     android:layout_width="wrap_content"
65                     android:layout_height="wrap_content"
66                     android:text="确认密码:"
67                     android:textSize="15sp"
68                     android:textColor="#000000"/>
69                 <EditText
70                     android:id="@+id/txtReRegPassword"
71                     android:layout_width="fill_parent"
72                     android:layout_height="35dp"
73                     android:hint="请输入确认登录密码:"
74                     android:textSize="12sp"
75                     android:textColor="#000000"
76                     android:inputType="textPassword"
77                     android:background="@drawable/txt_bg"
78                     android:paddingLeft="10dp"
79                     android:layout_marginTop="10dp"/>
80             </TableRow>
81         </TableLayout>
82         <LinearLayout
83             android:layout_width="fill_parent"
84             android:layout_height="wrap_content"
85             android:orientation="horizontal"
86             android:layout_marginTop="10dp">
87             <Button
88                 android:id="@+id/btnAdd"
89                 android:layout_width="0dp"
90                 android:layout_height="35dp"
91                 android:text="立即注册"
92                 android:textSize="15sp"
93                 android:textColor="#646464"
94                 android:layout_weight="1"
95                 android:background="@drawable/btn_reg_bg"
96                 android:layout_marginRight="5dp"/>
97         </LinearLayout>
98     </LinearLayout>
99 </RelativeLayout>
activity_register.xml

运行:

 

转载于:https://www.cnblogs.com/zulo/p/5081456.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值