注册登录界面 总结

1.Androidmanifest

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 3     package="com.example.administrator.myapplication">
 4
 5     <application
 6         android:allowBackup="true"
 7         android:icon="@mipmap/ic_launcher"
 8         android:label="@string/app_name"
 9         android:supportsRtl="true"
10         android:theme="@style/AppTheme">
11
12         <activity android:name=".MainActivity">
13             <intent-filter>
14                 <action android:name="android.intent.action.MAIN" />
15                 <category android:name="android.intent.category.LAUNCHER" />
16             </intent-filter>
17         </activity>
18         <activity android:name=".zhuceActivity">
19         </activity>
20     </application>
21
22 </manifest>

2.maniactivity.java

 1 package com.example.administrator.myapplication;
 2
 3 import android.content.Intent;
 4 import android.support.v7.app.AppCompatActivity;
 5 import android.os.Bundle;
 6 import android.view.View;
 7
 8 public class MainActivity extends AppCompatActivity {
 9
10     @Override
11     protected void onCreate(Bundle savedInstanceState) {
12         super.onCreate(savedInstanceState);
13         setContentView(R.layout.activity_main);
14     }
15     //view 代表事件发起
16     public void bt1_onclick(View v)
17     {
18         //带返回的打开 注册Acivity
19
20         //第一步:构造意图
21
22         Intent intent = new Intent(this,zhuceActivity.class);
23
24         startActivityForResult(intent,1);
25     }
26 }

3.zhuceActivity.java

 1 package com.example.administrator.myapplication;
 2
 3 import android.content.Intent;
 4 import android.support.v7.app.AppCompatActivity;
 5 import android.os.Bundle;
 6 import android.view.View;
 7 import android.widget.EditText;
 8 import android.widget.Toast;
 9
10 public class zhuceActivity extends AppCompatActivity {
11     EditText et_usercode1;
12     EditText et_password1;
13     EditText et_username1;
14     @Override
15     protected void onCreate(Bundle savedInstanceState) {
16         super.onCreate(savedInstanceState);
17         setContentView(R.layout.activity_zhuce);
18
19         et_usercode1 = (EditText)findViewById(R.id.et_usercode_1);
20         et_usercode1 = (EditText)findViewById(R.id.et_password_1);
21         et_usercode1 = (EditText)findViewById(R.id.et_username_1);
22     }
23     //view 代表事件发起
24     public void bt1_onclick(View v)
25     {
26
27         //返回注册信息
28         //用户代码
29         String usercode = et_usercode1.getText().toString();
30         if(usercode==null||usercode.trim().length()==0)
31         {
32             Toast.makeText(zhuceActivity.this, "请正确填写用户代码", Toast.LENGTH_LONG).show();
33
34             return;
35         }
36         String username = et_username1.getText().toString();
37         if(username==null||username.trim().length()==0)
38         {
39             Toast.makeText(zhuceActivity.this, "请正确填写用户名称", Toast.LENGTH_LONG).show();
40
41             return;
42         }
43         String userpassword =et_password1.getText().toString();
44         if(userpassword==null||userpassword.trim().length()==0)
45         {
46             Toast.makeText(zhuceActivity.this, "请正确填写用户名称", Toast.LENGTH_LONG).show();
47
48             return;
49         }
50
51         Intent intent = new Intent();
52
53         intent.putExtra("usercode",usercode);
54         intent.putExtra("username",username);
55         intent.putExtra("userpassword",userpassword);
56
57         setResult(RESULT_OK,intent);
58
59         finish();
60     }
61 }

4.Activity_mani.xml

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     xmlns:tools="http://schemas.android.com/tools"
 4     android:layout_width="match_parent"
 5     android:layout_height="match_parent"
 6     android:paddingBottom="@dimen/activity_vertical_margin"
 7     android:paddingLeft="@dimen/activity_horizontal_margin"
 8     android:paddingRight="@dimen/activity_horizontal_margin"
 9     android:paddingTop="@dimen/activity_vertical_margin"
10     tools:context="com.example.administrator.myapplication.MainActivity"
11     android:orientation="vertical">
12
13     <EditText
14         android:layout_width="match_parent"
15         android:layout_height="wrap_content"
16         android:hint="用户代码"
17         android:id="@+id/et_usercode"/> //获取密码
18     <EditText
19         android:layout_width="match_parent"
20         android:layout_height="wrap_content"
21         android:hint="密码"
22         android:id="@+id/et_password"
23         android:inputType="textPassword"/>
24     <LinearLayout
25         android:layout_width="match_parent"
26         android:layout_height="wrap_content">
27         <Button
28             android:layout_width="0dp"
29             android:layout_height="wrap_content"
30             android:layout_weight="1"
31             android:text="登录"/>
32         <Button
33             android:layout_width="0dp"
34             android:layout_height="wrap_content"
35             android:layout_weight="1"
36             android:text="密码"
37             android:onClick="bt1_onclick"/>
38     </LinearLayout>
39 </LinearLayout>

4.Actvity_zhuce.xml

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     xmlns:tools="http://schemas.android.com/tools"
 4     android:layout_width="match_parent"
 5     android:layout_height="match_parent"
 6     android:paddingBottom="@dimen/activity_vertical_margin"
 7     android:paddingLeft="@dimen/activity_horizontal_margin"
 8     android:paddingRight="@dimen/activity_horizontal_margin"
 9     android:paddingTop="@dimen/activity_vertical_margin"
10     tools:context="com.example.administrator.myapplication.zhuceActivity">
11     <EditText
12         android:layout_width="match_parent"
13         android:layout_height="wrap_content"
14         android:hint="用户代码"
15         android:id="@+id/et_usercode_1"/>
16     <EditText
17         android:layout_width="match_parent"
18         android:layout_height="wrap_content"
19         android:hint="用户名称"
20         android:id="@+id/et_username_1"
21         android:layout_below="@+id/et_usercode_1"/>
22     <EditText
23         android:layout_width="match_parent"
24         android:layout_height="wrap_content"
25         android:hint="登录密码"
26         android:id="@+id/et_password_1"
27         android:layout_below="@+id/et_username_1"/>
28     <LinearLayout
29         android:layout_width="match_parent"
30         android:layout_height="wrap_content"
31         android:layout_alignParentBottom="true">
32         <Button
33             android:layout_width="0dp"
34             android:layout_height="wrap_content"
35             android:layout_weight="1"
36             android:text="取消"
37             android:onClick="bt2_onclick"/>
38         <Button
39             android:layout_width="0dp"
40             android:layout_height="wrap_content"
41             android:layout_weight="1"
42             android:text="确定"
43             android:onClick="bt1_onclick"/>
44     </LinearLayout>
45 </RelativeLayout>
时间: 2024-08-30 00:14:37

注册登录界面 总结的相关文章

UI4_注册登录界面

// // ViewController.h // UI4_注册登录界面 // // Created by zhangxueming on 15/7/3. // Copyright (c) 2015年 zhangxueming. All rights reserved. // #import <UIKit/UIKit.h> #import "RegisterViewController.h" @interface ViewController : UIViewControl

Case2 注册登录界面

最终效果(此文仅呈现登录页的效果): 登录页 错误页 步骤: 1 拖入一个文本框,一个矩形(文字),一个动态面板 2.在动态面板设置几个状态:default lostFocusOk lostFocusError onFocus default:拖进一个矩形 场景:常态 lostFocusOk:拖入一个矩形,以及一个对的icon 使用场景:输入正确的时候 lostFocusError:两个矩形,右边的矩形是提供错误提示 使用场景:当无输入或者输入错误(不符合要求)的时候 onFocus:两个矩形,

RxSwift 实战操作【注册登录】

前言 看了前面的文章,相信很多同学还不知道RxSwift该怎么使用,这篇文件将带领大家一起写一个 注册登录(ps:本例子采用MVVM)的例子进行实战.本篇文章是基于RxSwift3.0写的,采用的是Carthage第三方管理工具导入的RxSwift3.0,关于Carthage的安装和使用,请参考Carthage的安装和使用. 最终效果 下载Demo点我 前提准备 首先请大家新建一个swift工程,然后把RxSwift引入到项目中,然后能够编译成功就行. 然后我们来分析下各个界面的需求: 注册界面

(实用篇)php注册和登录界面的实现案例(原文转载学习中)

当初我觉得一个网站上注册和登录这两个功能很神奇,后来自己研究一下发现其实道理很简单,接下来看一下怎么实现的吧.... http://mp.weixin.qq.com/s?__biz=MzIxMDA0OTcxNA==&mid=2654254777&idx=1&sn=76f8b02e5fbcc7041c9e67b459558194&chksm=8caa9964bbdd10722309af194a7ad9d30023d41b71d6a56a57199b73b1d5d989ac50

php注册和登录界面的实现案例

下面小编就为大家带来一篇php注册和登录界面的实现案例(推荐).挺不错的,现在就分享给大家,也给大家做个参考. 当初我觉得一个网站上注册和登录这两个功能很神奇,后来自己研究一下发现其实道理很简单,接下来看一下怎么实现的吧.... 我在我的电脑上建了几个文件: login.html (登录页面) register.html(注册页面) success.html(登录成功跳转页面) return.html(注册成功页面) login.php register.php 登录界面和注册界面以及succe

在登录界面隐藏某个账户的注册表文件

我创建一个本地账户是为了共享文件使用的,但是不想在登录界面显示这个账户,使用下面的方法可以简单做到隐藏. 将下面内容保存为ANSI格式的.reg文件,将YK007替换为要隐藏账户的名字.0表示不显示.以此类推可加入多个(行).双击导入注册表. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\U

用IOS做一个界面切换的效果(登录界面和注册界面和找回密码界面的切换)(用封装好的lable和textf创建界面)

创建一个类封装uitextfield和UIlabel (源代码.m文件) #import "TLView.h" @interface TLView () { UILabel *_desLabel;    //左边的lable UITextField *_textField;//右边的 } @end @implementation TLView //改写父类的初始化方法,处理相同的性能 - (id)initWithFrame:(CGRect)frame { self = [super i

php注册界面,实现php欢迎用户登录界面

实现效果如图: php实现代码如下: <!DOCTYPE HTML> <html><head> <meta name="" content=""charset="utf-8"/></head><body> <?php// define variables and set to empty values$name = $email = $gender = $comment

冲刺结果(补补补)——登录界面,找回密码和注册界面

设计思路:使用bootstrap,Ajax和bootstrap-validate以及fontawesome设计了学生登录界面和教师登录界面以及找回秘密和注册界面,通过添加一些图片,以及设计一些css样式形成比较好看的界面.并为其添加JavaBean和servlet实现相应的功能.通过cookie的储存和获取以及删除实现记住秘密功能. 代码:由于代码过于多所有不再这里展示了.可以在GitHub里查看源代码https://github.com/HxYyWw/-/tree/first-master 成