Android实现简单登录界面

Android实现简单登录界面,第1张

概述LoginActivity1packagecom.example.myapplication;23importandroid.os.Bundle;4importandroid.view.View;56importandroidx.annotation.Nullable;7importandroidx.appcompat.app.AppCompatActivity;89publicclassLoginActivityextendsAp LoginActivity
 1 package com.example.myapplication; 2  3 import androID.os.Bundle; 4 import androID.vIEw.VIEw; 5  6 import androIDx.annotation.Nullable; 7 import androIDx.appcompat.app.AppCompatActivity; 8  9 public class LoginActivity extends AppCompatActivity implements VIEw.OnClickListener{10     @OverrIDe11     protected voID onCreate(@Nullable Bundle savedInstanceState) {12         super.onCreate(savedInstanceState);13         setContentVIEw(R.layout.activity_login);14 15 16 17     }18 19     @OverrIDe20     public voID onClick(VIEw v) {21 22     }23 }
Activity_login
 1 <?xml version="1.0" enCoding="utf-8"?> 2 <relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" 3     androID:layout_wIDth="match_parent" 4     androID:layout_height="match_parent" 5     androID:layout_centerInParent="true" 6     > 7     <linearLayout 8         androID:ID="@+ID/ll_input" 9         androID:layout_centerInParent="true"10         androID:layout_wIDth="match_parent"11         androID:layout_height="wrap_content"12         androID:orIEntation="vertical">13         <linearLayout14             androID:layout_wIDth="match_parent"15             androID:layout_height="wrap_content"16             androID:orIEntation="horizontal"17             >18             <TextVIEw19                 androID:layout_wIDth="wrap_content"20                 androID:layout_height="wrap_content"21                 androID:wIDth="50dp"22                 androID:text="账号"23                 >24             </TextVIEw>25             <EditText26                 androID:layout_wIDth="match_parent"27                 androID:layout_height="wrap_content"28                 androID:hint="请输入账号" />29         </linearLayout>30         <linearLayout31             androID:layout_wIDth="match_parent"32             androID:layout_height="wrap_content"33             androID:orIEntation="horizontal"34             >35             <TextVIEw36                 androID:layout_wIDth="wrap_content"37                 androID:layout_height="wrap_content"38                 androID:wIDth="50dp"39                 androID:text="密码"40                 >41             </TextVIEw>42 43             <EditText44                 androID:layout_wIDth="match_parent"45                 androID:layout_height="wrap_content"46                 androID:hint="请输入密码" />47         </linearLayout>48         <button49             androID:layout_wIDth="match_parent"50             androID:layout_height="wrap_content"51             androID:text="登录"52             />53         <linearLayout54             androID:layout_wIDth="match_parent"55             androID:layout_height="wrap_content"56             androID:orIEntation="horizontal"57             >58             <button59                 androID:layout_wIDth="0dp"60                 androID:layout_height="wrap_content"61                 androID:layout_weight="1"62                 androID:text="注册"63                 />64             <button65                 androID:layout_wIDth="0dp"66                 androID:layout_height="wrap_content"67                 androID:layout_weight="1"68                 androID:text="忘记密码"69                 />70         </linearLayout>71     </linearLayout>72     <linearLayout73         androID:layout_wIDth="match_parent"74         androID:gravity="center"75         androID:orIEntation="vertical"76         androID:layout_height="match_parent"77         androID:layout_above="@ID/ll_input"78         >79         <ImageVIEw80             androID:layout_wIDth="wrap_content"81             androID:layout_height="wrap_content"82             androID:src="@androID:drawable/btn_star_big_on"83             ></ImageVIEw>84     </linearLayout>85     <TextVIEw86         androID:layout_wIDth="wrap_content"87         androID:layout_height="wrap_content"88         androID:layout_alignParentBottom="true"89         androID:layout_centerHorizontal="true"90         androID:text="最终解释权归本公司所有"91         >92     </TextVIEw>93 </relativeLayout>

效果图

 

总结

以上是内存溢出为你收集整理的Android实现简单登录界面全部内容,希望文章能够帮你解决Android实现简单登录界面所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1044866.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存