android 制作登录页

项目需要可以直接copy

layout.xml

XML 复制代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#E6E6FA">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:orientation="vertical"
        android:padding="30dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawableLeft="@mipmap/ic_launcher"
            android:text="QQ"
            android:textSize="40sp" />

        <EditText
            android:id="@+id/qq_account"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:hint="QQ号码/邮箱/电话号码"
            android:textSize="30sp" />

        <EditText
            android:id="@+id/qq_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="密码"
            android:inputType="textPassword"
            android:textSize="30sp" />

        <Button
            android:id="@+id/qq_login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="登录"
            android:textSize="40sp" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="忘记密码"
                android:textColor="#00aaff"
                android:textSize="16sp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:text="新用户注册"
                android:textColor="#00aaff"
                android:textSize="16sp" />
        </RelativeLayout>

        <Button
            android:id="@+id/bt_sd_save"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="存储到sd卡"
            android:textSize="15dp" />

    </LinearLayout>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="80dp"
        android:text="登录即代表阅读并同意阅读条例"
        android:textSize="20sp" />

</RelativeLayout>

效果图:

相关推荐
阿巴斯甜4 分钟前
Android Studio 新版 Logcat
android
监督者修22 分钟前
从零构建 GIS 数据引擎:方案驱动架构的设计与实践
android·架构·kotlin
Yoke27 分钟前
从零到三端:用 Kotlin Multiplatform + Compose 构建跨平台财务追踪应用
android
gxgldyh38 分钟前
Android Framework源码解析(六):Launcher3 启动流程详解——AMS 如何拉起系统桌面?
android
XiaoLeisj39 分钟前
HandlerThread 与 IntentService 使用及源码解析
android·handler
我命由我1234510 小时前
Android Studio - Android Studio 自定义预览尺寸
android·java·ide·java-ee·android studio·android-studio·android runtime
取个名字太难了~12 小时前
越用越便宜,越用越强大:影像 SDK 的边际成本递减与网络效应实践
android·数码相机·美颜·相机连接·demu
AFinalStone16 小时前
Android 7系统网络(四)Native层(下)—netd Controller详解
android·网络
爱笑鱼16 小时前
Handler(一):post 之后,Runnable 到底在哪个线程执行?
android
木木子2217 小时前
[特殊字符] 音乐播放器——状态驱动的多媒体控制
android·开发语言·华为·php·harmonyos