广告
返回顶部
首页 > 资讯 > 精选 >Android怎么实现注册页面
  • 149
分享到

Android怎么实现注册页面

2023-06-30 09:06:08 149人浏览 独家记忆
摘要

本文小编为大家详细介绍“Android怎么实现注册页面”,内容详细,步骤清晰,细节处理妥当,希望这篇“Android怎么实现注册页面”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。实现的效果图:代码:package

本文小编为大家详细介绍“Android怎么实现注册页面”,内容详细,步骤清晰,细节处理妥当,希望这篇“Android怎么实现注册页面”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。

实现的效果图:

Android怎么实现注册页面

代码:

package com.example.project309; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.CheckBox;import android.widget.EditText;import android.widget.RadioButton;import android.widget.TextView; public class MainActivity extends AppCompatActivity {    EditText name;    EditText passWord;    RadioButton man;    RadioButton woman;    Button  show;    TextView shower;    CheckBox auto;    CheckBox remember;    String  result="";     @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_main);        name = findViewById(R.id.name);        password = findViewById(R.id.password);        man = findViewById(R.id.man);        woman = findViewById(R.id.woman);        show = findViewById(R.id.show);        shower = findViewById(R.id.shower);        auto = findViewById(R.id.auto);        remember = findViewById(R.id.remember);        show.setOnClickListener(this::onClick);    }    public void onClick(View v){        String user = name.getText().toString();        result +="姓名:"+user+"\n";        String pass =password.getText().toString();        result +="密码:"+pass+"\n";        if(man.isChecked()){            result+="性别:"+man.getText().toString()+"\n"+"设置:";        }        if(woman.isChecked()){            result+="性别:"+woman.getText().toString()+"\n"+"设置:";        }        if(auto.isChecked()){            result+=auto.getText().toString()+" ";        }        if(remember.isChecked()){            result+=remember.getText().toString()+" ";        }       shower.setText(result);    }}

XML:

<?xml version="1.0" encoding="utf-8"?><LinearLayout 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"    android:orientation="vertical"    tools:context=".MainActivity"><LinearLayout    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:orientation="horizontal">    <ImageView        android:layout_width="180dp"        android:layout_height="159dp"        android:src="@drawable/qq" />    <LinearLayout        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:orientation="vertical"        >     <TableLayout        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:id="@+id/table1">         <TableRow>             <TextView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="用户名"                android:textColor="#000000"                android:textSize="20dp" />             <EditText                android:id="@+id/name"                android:layout_width="150dp"                android:layout_height="wrap_content" />         </TableRow>         <TableRow>            <TextView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="密码"                android:textColor="#000000"                android:textSize="20dp" />            <EditText                android:id="@+id/password"                android:layout_width="150dp"                android:layout_height="wrap_content" />         </TableRow>       <TableRow>            <RadioButton                android:id="@+id/man"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="男" />             <RadioButton                android:id="@+id/woman"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="女" />        </TableRow>        <LinearLayout            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:orientation="horizontal"            >            <CheckBox                android:id="@+id/auto"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:checked="true"                android:text="自动登录"                android:textSize="18dp" />             <CheckBox                android:id="@+id/remember"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:checked="true"                android:text="记住密码"                android:textSize="18dp" />        </LinearLayout>    </TableLayout>    </LinearLayout></LinearLayout>    <Button        android:id="@+id/show"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:text="注册"        android:textSize="20dp"        />    <TextView        android:layout_width="match_parent"        android:layout_height="300dp"        android:id="@+id/shower"/></LinearLayout>

读到这里,这篇“Android怎么实现注册页面”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注编程网精选频道。

--结束END--

本文标题: Android怎么实现注册页面

本文链接: https://www.lsjlt.com/news/327931.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Android怎么实现注册页面
    本文小编为大家详细介绍“Android怎么实现注册页面”,内容详细,步骤清晰,细节处理妥当,希望这篇“Android怎么实现注册页面”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。实现的效果图:代码:package...
    99+
    2023-06-30
  • Android实现注册页面
    本文用Android studio制作了简单的手机QQ登录界面,其中界面的布局采用了线性布局、表格布局(不固定布局方法),并给控件绑定监听器,当用户点击登陆按钮时,把用户所填写的注册...
    99+
    2022-11-13
  • Android Studio怎么实现注册页面跳转登录页面
    今天小编给大家分享一下Android Studio怎么实现注册页面跳转登录页面的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了...
    99+
    2023-06-30
  • android实现注册页面开发
    本文实例为大家分享了android实现注册页面开发的具体代码,供大家参考,具体内容如下 在values文件里创建以下几个文件 colors代码: <xml version=...
    99+
    2022-11-13
  • Android实现登录注册页面(上)
    简单的Android开发登录注册,这个是没有连数据库的。 首先,新建项目,新建一个登录页面LoginActivity和注册页面RegisterActivity。 下面是登录页面的代码...
    99+
    2022-11-13
  • Android实现登录注册页面(下)
    前面我们已经完成了登录注册页面的布局,下面我们实现验证登录和记住密码的功能。 我们这里还没用到数据库,所以我们的验证的账号密码,是写死的。 首先进入登录页面,可以从这里跳转到注册页面...
    99+
    2022-11-13
  • Android studio 实现app登录注册页面
    目录 activity_main.xml代码如下 MainActivity.java代码如下 用于高校实现Android studio专业课作业提交,如确实有用,欢迎观众姥爷打赏 该页面实现了注册页面的布局效果,包含用户名,密码,忘记密...
    99+
    2023-10-06
    android-studio adb android android studio
  • JavaScript怎么实现注册登录页面
    本篇内容介绍了“JavaScript怎么实现注册登录页面”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成! ...
    99+
    2022-10-19
  • JavaWeb之Servlet注册页面怎么实现
    这篇“JavaWeb之Servlet注册页面怎么实现”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“JavaWeb之Servl...
    99+
    2023-06-30
  • Android实现注册界面
    本文实例为大家分享了Android实现注册界面的具体代码,供大家参考,具体内容如下 LinearLayout 控制布局TextView 用于显示文字EditText 输入框Radio...
    99+
    2022-11-13
  • Android怎么实现注册页面并携带数据包跳转
    这篇文章主要讲解了“Android怎么实现注册页面并携带数据包跳转”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Android怎么实现注册页面并携带数据包跳转”吧!效果:实现1.创建安卓文件...
    99+
    2023-06-30
  • Android实现带头像的用户注册页面
    1.首先是注册页面的布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout x...
    99+
    2022-06-06
    Android
  • JS、CSS和HTML怎么实现注册页面
    小编给大家分享一下JS、CSS和HTML怎么实现注册页面,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!更新:使用JavaScript实现用户名和密码表单校验功能。...
    99+
    2023-06-20
  • Java怎么实现登录与注册页面
    本文小编为大家详细介绍“Java怎么实现登录与注册页面”,内容详细,步骤清晰,细节处理妥当,希望这篇“Java怎么实现登录与注册页面”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。用java实现的登录与注册页面,实...
    99+
    2023-06-30
  • Android实现注册页面(携带数据包跳转)
    安卓学习:实现注册页面输入数据,点击注册按钮跳转到另一个页面并显示输入信息 效果: 实现 1.创建安卓文件 2.创建注册界面,勾选为启动页 3.编写代码 启动界面activi...
    99+
    2022-11-13
  • jsp注册按钮跳转页面怎么实现
    要实现jsp注册按钮跳转页面,可以使用以下方法:1. 使用HTML表单:在jsp页面中创建一个HTML表单,其中包含一个注册按钮,并...
    99+
    2023-08-09
    jsp
  • node.js实现登录注册页面
    本文实例为大家分享了node.js登录注册页面展示的具体代码,供大家参考,具体内容如下 首先需要新建四个文件 一个服务器js 一个保存数据的txt 一个登陆、一个注册页面html 1、注册页面 <...
    99+
    2022-06-04
    页面 node js
  • javaweb实现注册登录页面
    本文实例为大家分享了javaweb实现注册登录页面的具体代码,供大家参考,具体内容如下 <%@ page language="java" contentType="text/h...
    99+
    2022-11-13
  • 怎么用jquery实现员工管理注册页面
    这篇文章主要讲解了“怎么用jquery实现员工管理注册页面”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“怎么用jquery实现员工管理注册页面”吧!代码展示HTML页面代码<body&...
    99+
    2023-06-20
  • JS、CSS和HTML实现注册页面
    一个用HTML和CSS实现的注册页面模板,废话不多说了,上代码! 更新:使用JavaScript实现用户名和密码表单校验功能。 代码如下: <!DOCTYPE html&g...
    99+
    2022-11-12
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作