iis服务器助手广告广告
返回顶部
首页 > 资讯 > 移动开发 >Android实现注册界面
  • 1004
分享到

Android实现注册界面

2024-04-02 19:04:59 1004人浏览 泡泡鱼
摘要

本文实例为大家分享了Android实现注册界面的具体代码,供大家参考,具体内容如下 LinearLayout 控制布局TextView 用于显示文字EditText 输入框Radio

本文实例为大家分享了Android实现注册界面的具体代码,供大家参考,具体内容如下

LinearLayout 控制布局
TextView 用于显示文字
EditText 输入框
RadioGroup 单选按钮和RadioButton一起用
CheckBox 复选框
Spinner 下拉框

源码

reGISter.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="Http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="6dp"
            android:layout_marginTop="10dp"
            android:text="用户名:"
            android:textSize="15dp"
            android:textColor="@color/colorPrimary"
            />
        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="6dp"
            android:layout_marginTop="10dp"
            android:hint="输入2-10个字符"
            android:textColor="@color/colorPrimary"
            android:layout_weight="1"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="6dp"
            android:layout_marginTop="10dp"
            android:text="密码:    "
            android:textSize="15dp"
            android:textColor="@color/colorPrimary"
            />
        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="6dp"
            android:layout_marginTop="10dp"
            android:hint="输入6-10个字符"
            android:textColor="@color/colorPrimary"
            android:layout_weight="1"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="6dp"
            android:layout_marginTop="23Dp"
            android:text="性别选择:    "
            android:textSize="15dp"
            android:textColor="@color/colorPrimary"
            />
        <RadioGroup
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp">
            <RadioButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="30dp"
                android:layout_marginTop="6dp"
                android:text="男"/>
            <RadioButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="30dp"
                android:layout_marginTop="6dp"
                android:text="女"/>

        </RadioGroup>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="6dp"
            android:textSize="15dp"
            android:text="爱好选择:"
            android:textColor="@color/colorPrimaryDark"/>
        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:layout_marginLeft="20dp"
            android:text="游泳"/>
        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:layout_marginLeft="20dp"
            android:text="打球"/>
        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:layout_marginLeft="20dp"
            android:text="看书"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="6dp"
            android:textSize="15dp"
            android:text="所在地"/>
        <Spinner
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:layout_marginLeft="10dp"
            android:entries="@array/citys">

        </Spinner>
    </LinearLayout>
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="注册"
        android:textColor="@color/colorPrimaryDark"/>

</LinearLayout>

strings.xml

<resources>
    <string name="app_name">Register</string>
    <string-array name="citys">
        <item>赣州</item>
        <item>上海</item>
        <item>广州</item>
        <item>深圳</item>
        <item>北京</item>
        <item>湖南</item>
        <item>湖北</item>
        <item>南宁</item>
        <item>厦门</item>
    </string-array>
</resources>

Main.java

package com.example.hsy.register;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.register);
    }
}

效果图

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程网。

--结束END--

本文标题: Android实现注册界面

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

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

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

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

下载Word文档
猜你喜欢
  • Android实现注册界面
    本文实例为大家分享了Android实现注册界面的具体代码,供大家参考,具体内容如下 LinearLayout 控制布局TextView 用于显示文字EditText 输入框Radio...
    99+
    2024-04-02
  • Android实现登录注册界面框架
    小项目框架 今天用QQ的时候想到了,不如用android studio 做一个类似于这样的登录软件。当然QQ的实现的功能特别复杂,UI界面也很多,不是单纯的一时新奇就可以做出来的。就...
    99+
    2024-04-02
  • Android实现登录界面的注册功能
    本文实例为大家分享了Android登录界面的注册实现代码,供大家参考,具体内容如下 注册一个登录界面在控制台将输入的信息文本选框展示出来 xml界面设计(前面已发) <xml ...
    99+
    2024-04-02
  • Android实现注册页面
    本文用Android studio制作了简单的手机QQ登录界面,其中界面的布局采用了线性布局、表格布局(不固定布局方法),并给控件绑定监听器,当用户点击登陆按钮时,把用户所填写的注册...
    99+
    2024-04-02
  • Android如何实现登录界面的注册功能
    今天小编给大家分享一下Android如何实现登录界面的注册功能的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。注册一个登录界面...
    99+
    2023-06-30
  • java实现登录注册界面
    本文实例为大家分享了java实现登录注册界面的具体代码,供大家参考,具体内容如下 数据库设计 既然只是一个登录和注册的界面,数据库方面就只设计一个Admin表,表内有三个值。 id...
    99+
    2024-04-02
  • android实现注册页面开发
    本文实例为大家分享了android实现注册页面开发的具体代码,供大家参考,具体内容如下 在values文件里创建以下几个文件 colors代码: <xml version=...
    99+
    2024-04-02
  • Android怎么实现注册页面
    本文小编为大家详细介绍“Android怎么实现注册页面”,内容详细,步骤清晰,细节处理妥当,希望这篇“Android怎么实现注册页面”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。实现的效果图:代码:package...
    99+
    2023-06-30
  • android实现简易登录注册界面及逻辑设计
    本文实例为大家分享了android实现登录注册界面及逻辑设计,供大家参考,具体内容如下 1. 第一步 新建文件(相信各位码农一定会这一步)略。 2. 第二步 登录注册界面设计 登录界...
    99+
    2024-04-02
  • JS实现注册界面表单校验
    本文实例为大家分享了JS实现注册界面表单校验的具体代码,供大家参考,具体内容如下 设计效果: 源码: <!DOCTYPE html> <html>     ...
    99+
    2024-04-02
  • JS实现用户注册界面功能
    本文实例为大家分享了JS实现用户注册界面功能的具体代码,供大家参考,具体内容如下   1.css代码 *{ margin: 0; ...
    99+
    2024-04-02
  • java如何实现登录注册界面
    这篇文章主要介绍“java如何实现登录注册界面”,在日常操作中,相信很多人在java如何实现登录注册界面问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”java如何实现登录注册界面”的疑惑有所帮助!接下来,请跟...
    99+
    2023-07-02
  • Android实现登录注册页面(上)
    简单的Android开发登录注册,这个是没有连数据库的。 首先,新建项目,新建一个登录页面LoginActivity和注册页面RegisterActivity。 下面是登录页面的代码...
    99+
    2024-04-02
  • Android实现登录注册页面(下)
    前面我们已经完成了登录注册页面的布局,下面我们实现验证登录和记住密码的功能。 我们这里还没用到数据库,所以我们的验证的账号密码,是写死的。 首先进入登录页面,可以从这里跳转到注册页面...
    99+
    2024-04-02
  • Android Studio 实现登录和注册功能的实现及界面布局介绍
    Android Studio 实现登录和注册功能的实现及界面布局介绍 在 Android Studio 中实现登录和注册功能是开发安卓应用程序中常见的任务。本文将介绍如何通过编写代码实现这两个功能,并...
    99+
    2023-10-23
    android studio android ide Android
  • Android studio 实现app登录注册页面
    目录 activity_main.xml代码如下 MainActivity.java代码如下 用于高校实现Android studio专业课作业提交,如确实有用,欢迎观众姥爷打赏 该页面实现了注册页面的布局效果,包含用户名,密码,忘记密...
    99+
    2023-10-06
    android-studio adb android android studio
  • 微信小程序实现登录注册界面
    本文实例为大家分享了微信小程序实现登录注册界面的具体代码,供大家参考,具体内容如下 微信小程序登录注册界面demo,存在不足之处,请指教! 界面图片: 1.js代码: Page(...
    99+
    2024-04-02
  • Java实现简单GUI登录和注册界面
    本文实例为大家分享了Java实现简单GUI登录和注册界面的具体代码,供大家参考,具体内容如下 先看效果图: 登陆界面: 注册界面: 实现代码如下: 一、登陆界面 package ...
    99+
    2024-04-02
  • php 怎么实现用户注册登录界面
    本教程操作环境:Windows7系统、PHP8.1版、Dell G3电脑。php 怎么实现用户注册登录界面?PHP登录与注册页面简单实现(包含数据库验证)(包含数据库)log.php(登录主界面)由于是简单的页面,登录页面只做了数据库验证,...
    99+
    2022-11-19
    php
  • php如何实现用户注册登录界面
    今天小编给大家分享一下php如何实现用户注册登录界面的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。php实现用户注册登录界面...
    99+
    2023-07-04
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作