刚刚学习Android开发,现在工作需要开发一个app的演示程序,首先就是要开发一个登录界面了。在网上找了很多材料,最后参考了博客中的登录界面设计方法:

blog.csdn.net/StayFoolish_Fan/article/details/51933563?locationNum=8

最终我设计的登录界面以及注册界面如图所示:

                              

登录界面布局代码为:activity_login.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/activity_login"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.v7.widget.Toolbarandroid:id="@+id/toolbar"android:layout_width="match_parent"android:layout_height="?attr/actionBarSize"android:background="?attr/colorPrimary"android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/><RelativeLayoutandroid:id="@+id/login_view"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_centerInParent="true"android:layout_below="@+id/toolbar"android:focusable="true"android:focusableInTouchMode="true"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/login_edit_pwd"android:layout_margin="20dp"><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="登录"android:id="@+id/login_btn_login"android:background="#545bcb"android:textSize="20sp"android:textColor="#ffffff"android:layout_marginTop="52dp"android:layout_marginRight="50dp"android:layout_marginLeft="10dp"/><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="注册"android:id="@+id/login_btn_register"android:textColor="#ffffff"android:background="#e52525"android:textSize="20sp"android:layout_marginTop="52dp"android:layout_marginLeft="50dp"/></LinearLayout><ImageViewandroid:layout_width="300dp"android:layout_height="150dp"android:id="@+id/logo"android:layout_alignParentRight="true"android:layout_alignParentEnd="true"android:layout_alignParentLeft="true"android:layout_alignParentStart="true"android:layout_alignParentTop="true"android:layout_alignWithParentIfMissing="false"android:background="#ffffff"android:src="@drawable/ca"/><EditTextandroid:layout_width="400dp"android:layout_height="60dp"android:inputType="textPassword"android:ems="10"android:id="@+id/login_edit_pwd"android:drawableLeft="@android:drawable/ic_lock_idle_lock"android:hint="请输入您的密码"android:layout_below="@+id/login_edit_account"android:layout_alignParentLeft="true"android:layout_alignParentStart="true"/><EditTextandroid:layout_width="400dp"android:layout_height="60dp"android:inputType="textPersonName"android:id="@+id/login_edit_account"android:drawableLeft="@android:drawable/ic_menu_myplaces"android:hint="请输入您的用户名"android:layout_below="@+id/logo"android:layout_alignParentLeft="true"android:layout_alignParentStart="true"android:layout_marginTop="20dp"/><LinearLayoutandroid:orientation="vertical"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/login_edit_pwd"><CheckBoxandroid:id="@+id/Login_Remember"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="记住密码"android:layout_marginLeft="10dp"android:checked="false"android:textSize="15sp" /><TextViewandroid:id="@+id/login_fail_reason"android:layout_width="match_parent"android:layout_height="wrap_content"android:textColor="#f71818"android:textSize="20sp"/></LinearLayout></RelativeLayout>
</RelativeLayout>

注册界面布局代码:activity_register.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"android:orientation="vertical"android:id="@+id/activity_register"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.v7.widget.Toolbarandroid:id="@+id/toolbar"android:layout_width="match_parent"android:layout_height="?attr/actionBarSize"android:background="?attr/colorPrimary"android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/><EditTextandroid:drawableLeft="@android:drawable/ic_menu_myplaces"android:layout_width="match_parent"android:layout_height="wrap_content"android:inputType="textPersonName"android:ems="10"android:id="@+id/resetpwd_edit_name"android:hint="请输入您的用户名"android:focusable="true"android:focusableInTouchMode="true"/><EditTextandroid:drawableLeft="@android:drawable/ic_lock_idle_lock"android:layout_width="match_parent"android:layout_height="wrap_content"android:inputType="textPassword"android:ems="10"android:id="@+id/resetpwd_edit_pwd_old"android:hint="请输入您的密码"/><EditTextandroid:drawableLeft="@android:drawable/ic_lock_idle_lock"android:layout_width="match_parent"android:layout_height="wrap_content"android:inputType="textPassword"android:ems="10"android:id="@+id/resetpwd_edit_pwd_new"android:layout_centerHorizontal="true"android:hint="请确认您的密码" /><TextViewandroid:id="@+id/register_fail_reason"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/resetpwd_edit_pwd_new"android:textColor="#f71818"android:textSize="25sp"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/register_fail_reason"><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="确定"android:id="@+id/register_btn_sure"android:textSize="20sp"android:background="#1cf718"android:layout_marginTop="20dp"android:layout_marginRight="20dp"/><Buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="取消"android:id="@+id/register_btn_cancel"android:textSize="20sp"android:background="#f71818"android:layout_marginTop="20dp"android:layout_marginLeft="20dp"/></LinearLayout></LinearLayout>

我这里没有使用Activity自带的标题栏,而是使用了更加牛逼一点的ToolBar,所以要想直接使用上面的界面代码的话还需要在工程中引入ToolBar的使用。

Android程序登录界面设计相关推荐

  1. Android之登录界面设计

    Android之登录界面设计 这篇文章主要讲述Android开发中常用的APP开发界面–登录界面的开发(由于博主是初学安卓,可能有些小伙伴会感到简陋,我会继续努力学习新知识的,大家一起加油). (1) ...

  2. android登陆按钮图片素材,Android精美登录界面设计

    在网上在到一个登录界面感觉挺不错的,给大家分享一下~先看效果图: 这个Demo除了按钮.小猫和Logo是图片素材之外,其余的UI都是通过代码实现的. 一.背景 背景蓝色渐变,是通过一个xml文件来设置 ...

  3. Android APP登录界面设计

    为平板设计的登录界面,可以实现的功能有登录,忘记密码,记住密码,用户注册.(只设计界面,为了练习界面布局) 其中包括了EditText.TextView.CheckBox.Button控件. < ...

  4. 某触摸屏程序登录界面设计

    程序界面布局如下图 1.新建一个Windows应用程序. 2.界面布局如上图. 3.设置窗体的StartPosition属性值为CenterScreen,WindowState属性为Maximized ...

  5. web登录界面设计_出色的Web界面设计的7条规则

    web登录界面设计 When you work on a website or on the design of web pages, remember that their success is n ...

  6. pyqt5登录界面设计——模仿qq登录界面,可登录注册(数据库)

    pyqt5登录界面设计--模仿qq登录界面 一.简单易用的可直接登录的界面--账号密码程序写死 1.1.效果图: 1.2.视频效果图 3.代码说明 4.使用示例 5.全部源码见: 二.带数据库的可登录 ...

  7. 毕业设计——登录界面设计

    我根据QQ登录界面设计的本次毕设校园环境监测系统的登录界面,也不知道好看与否,本人觉得还蛮可以的,嘿嘿,界面如下: 已经实现了的功能: ①登录按钮:能够连接上数据库的Userinfo表,进行用户登录功 ...

  8. Android官方建议关于Android APP UI界面设计的一些参考原则

    下面是来自于Android官网给出了关于Android APP UI界面设计的一些参考原则,希望对广大ui设计师能带来帮助,尤其是在进行Andriod相关界面设计的时候. 一.清晰是UI界面第一位,也 ...

  9. 登录界面设计及功能实现

    文章目录 1 登录界面设计 1.1 登录界面设计 1.2 登录界面设计要点 1 登录界面设计 1.1 登录界面设计 界面效果如下: 1.2 登录界面设计要点 我们需要先将窗体设置为无边框,然后再设置窗 ...

最新文章

  1. mysql5.1 与mysql5.5 字符集设置区别
  2. 题目1015:还是A+B
  3. 计算机组网技术与配置 pdf,教案计算机组网技术.pdf
  4. java输出回文数原代码_C++编程入门:判断回文数
  5. 建模matlab仿真视频教程,Simulink建模与仿真视频教程
  6. “国潮” MCU厂商列表
  7. 个性化推荐系统设计(4.1)——案例分析
  8. The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0 维度不匹配
  9. 深入浅出图神经网络|GNN原理解析☄学习笔记(四)表示学习
  10. GPT系列简介与gpt训练(nanoGPT)
  11. 可计算性、可判定性和可满足性
  12. oss系统和bss系统 mss系统是什么意思
  13. YMIR-人脸检测-深度学习模型一站式开发
  14. HTML+CSS+JS 网页设计期末课程大作业(旅游景点--南京 15页) web前端开发技术 web课程设计 网页规划与设计
  15. 冯巩台上的经典155条短语 句句经典啊
  16. 计算机一级改扩展名,如果改变文件扩展名 修改教程分享【图解】
  17. 王者该服务器未获取角色信息,王者荣耀体验服现实未获取角色信息 | 手游网游页游攻略大全...
  18. CSS 使图片看起来有立体感样式
  19. 【无线通信模块】GPRS DTU不稳定和容易掉线原因
  20. TCP/IP详解 第七章 防火墙和网络地址转换(1)

热门文章

  1. linux安装autossh详细教程,Linux系统入门学习:如何安装autossh
  2. 一张图把DCDC电源拓扑“融会贯通”
  3. 2022年江西省中职组“网络空间安全”赛项模块A解析
  4. 尼康相机照片怎么恢复
  5. 共轭梯度法 (CG) 解线性方程组
  6. dolphinscheduler-1.3 worker分组管理配置
  7. Matlab如何安装并使用Robotics 机器人工具箱
  8. 我与小娜(13):LIGO是什么组织?
  9. 听说北京有个兄弟连!
  10. 带来新奇应用的HI! MORFEI 智能家居开发大赛有科大讯飞的什么“秘密”?