用户注册界面

本文主要介绍了如何在安卓应用中实现用户注册界面,包括数据传递、窗口跳转以及相关知识点,如线性布局、TextView、EditText、Button、事件处理、Toast和Intent的使用。通过创建注册Activity和显示注册信息Activity,结合布局文件和Java类,实现了注册信息的展示和界面间的交互。
摘要由CSDN通过智能技术生成

一、要求:实现注册信息的数据传递与窗口跳转

从注册界面输入信息后
在这里插入图片描述
跳转到注册信息界面,并将注册信息呈现在界面上
在这里插入图片描述
二、涉及知识点
1、线性布局(LinearLayout)
2、标签(TextView)
3、编辑框(EditText)
4、按钮(Button)
5、安卓事件处理机制
6、吐司(Toast)
7、意图(Intent)
(1)功能作用:联系安卓不同组件之间的一个重要桥梁
(2)使用方式:显式使用方式(直接指定目标组件)和隐式使用方式(通过意图过滤器来筛选)
三、实现步骤
1、在简单用户登录界面的项目里基于AS的Activity模板来创建注册Activity和注册信息Activity
在这里插入图片描述
2、字符串资源文件strings.xml
在这里插入图片描述
3、布局文件activity_register.xml
在这里插入图片描述

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"
    android:background="@mipmap/login_background">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/activity_register_name"
            android:textSize="20dp"/>
        <EditText
            android:id="@+id/edt_name"
            android:layout_width="250dp"
            android:layout_height="wrap_content"
            android:ems="10"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_sex"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/activity_register_sex"
            android:textSize="20dp"/>
        <EditText
            android:id="@+id/edt_sex"
            android:layout_width="250dp"
            android:layout_height="wrap_content"
            android:ems="10"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_age"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/activity_register_age"
            android:textSize="20dp"/>
        <EditText
            android:id="@+id/edt_age"
            android:layout_width="250dp"
            android:layout_height="wrap_content"
            android:ems="10"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_phone"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/activity_register_phone"
            android:textSize="20dp"/>
        <EditText
            android:id="@+id/edt_phone"
            android:layout_width="250dp"
            android:layout_height="wrap_content"
            android:ems="10"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id=
  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值