zoukankan      html  css  js  c++  java
  • android注册功能

    注册功能的布局文件

    activity_register.xml文件

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="com.example.justloginregistertest.RegisterActivity"
        android:background="#eeeeee"
        >
    
        <RelativeLayout
            android:id="@+id/rl_registeractivity_top"
            android:layout_width="match_parent"
            android:layout_height="70dp"
            android:background="@color/color_minefragment_top"
            >
          <ImageView
              android:id="@+id/iv_registeractivity_back"
              android:layout_width="30dp"
              android:layout_height="30dp"
              android:background="@drawable/ic_left_back"
              android:layout_centerVertical="true"
              android:layout_marginLeft="10dp"
              android:clickable="true"
              android:onClick="onClick"
              />
    
           <TextView
               android:id="@+id/tv_registeractivity_register"
               android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:text="注册"
               android:textColor="#fff"
               android:textSize="20dp"
               android:layout_toRightOf="@+id/iv_registeractivity_back"
               android:layout_centerVertical="true"
               android:layout_marginLeft="20dp"
               />
        </RelativeLayout>
    
        <LinearLayout
            android:id="@+id/ll_registeractivity_body"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_below="@+id/rl_registeractivity_top"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            >
    <!-- 第一个文本编辑框  输入用户名 -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
                <TextView
                    android:id="@+id/tv_registeractivity_username"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="用户名:"/>
                <EditText
                    android:id="@+id/et_registeractivity_username"
                    android:layout_width="match_parent"
                    android:layout_height="50dp"
                    android:hint="请输入用户名"
                    android:gravity="center_vertical"
                    android:layout_marginLeft="10dp"
                    />
            </LinearLayout>
    <!-- 第二个文本编辑框  输入密码 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <TextView
                android:id="@+id/tv_registeractivity_password1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="密    码:"/>
            <EditText
                android:id="@+id/et_registeractivity_password1"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:gravity="center_vertical"
                android:layout_marginLeft="10dp"
                android:inputType="textPassword"
                android:hint="请输入密码" />
        </LinearLayout>
    <!-- 第三个文本编辑框  再次输入密码 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <TextView
                android:id="@+id/tv_registeractivity_password2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="密    码:"/>
            <EditText
                android:id="@+id/et_registeractivity_password2"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:hint="请再次输入密码"
                android:gravity="center_vertical"
                android:layout_marginLeft="10dp"
                android:inputType="textPassword"
                />
        </LinearLayout>
    <!-- 验证码部分 -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginRight="15dp"
                android:layout_marginTop="10dp"
                android:orientation="horizontal" >
                <!-- 第四个文本编辑框  输入验证码 -->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">
                    <TextView
                        android:id="@+id/tv_registeractivity_phoneCodes"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="验证码:"/>
                    <EditText
                        android:id="@+id/et_registeractivity_phoneCodes"
                        android:layout_width="0dp"
                        android:layout_weight="3"
                        android:layout_height="50dp"
                        android:layout_marginLeft="10dp"
                        android:layout_marginRight="10dp"
                        android:hint="请输入4位验证码" />
    
                    <ImageView
                        android:id="@+id/iv_registeractivity_showCode"
                        android:layout_width="0dp"
                        android:layout_height="70dp"
                        android:layout_weight="1.5"
                        android:clickable="true"
                        android:onClick="onClick"
                        android:layout_marginTop="-10dp"
                    />
                </LinearLayout>
            </LinearLayout>
            <!-- 注册按钮 -->
            <Button
                android:id="@+id/bt_registeractivity_register"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:layout_marginLeft="5dp"
                android:background="@drawable/selector_loginactivity_button"
                android:textColor="#fff"
                android:text="注册"
                android:onClick="onClick"
                android:layout_marginTop="40dp"
                />
    
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:id="@+id/rl_registeractivity_bottom"
                android:layout_marginTop="10dp"
                >
                <TextView
                    android:layout_centerInParent="true"
                    android:text="注册即代表同意《用户协议》"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>
            </RelativeLayout>
    
        </LinearLayout>
    
    </RelativeLayout>

    界面效果:

  • 相关阅读:
    多线程--ThreadLocal类
    常用开发类库支持--UUID及空值处理Optional
    国际化的程序实现及其原理
    浅析java设计模式(一)----异构容器,可以存储任何对象类型为其他类提供该对象
    使用批处理命令注册运行mysql数据库,无需注册mysql服务,可以在任意电脑登录使用
    计算机中位、字长、字的区别
    SQL Server用户自定义数据类型
    简单的回合制小游戏
    单链表创建、删除、查找、插入之C语言实现
    LeetCode-905 Sort Array By Parity Solution (with Java)
  • 原文地址:https://www.cnblogs.com/znjy/p/14891915.html
Copyright © 2011-2022 走看看