序章:

今天做了个登录界面,新学了<ImageView>控件,<TextView>空间和输入框<EditText>,主要考验的还是布局的使用。还有边距。

图片控件<ImageView>:

顾名思义嘛,图片控件当然是插入图片的,图片嘛可以设置的高度和宽度都是自适应和充满,什么你问我什么是自适应和充满?自己去day_01看,图片没什么好说的,实际上他也是算是一个控件,只不过插入的是图片罢了。

文字控件<TextView>

顾名思义嘛,文字控件肯定是插入文字的,写完了之后文字就显示出来啦,但是请你千万记住,文字的敢赌和宽度只能设置为自适应,啥,为什么?找我老师说去,我哪知道,自适应就是宽度和高度都是“wrap_content”,当然了文字肯定是会有内容的,内容也是使用<android:text="内容">,那么,文字肯定是需要有大小的,android:textSize="20dp"这就是设置大小的方法,dp是单位,啥?为啥是dp,肯定不是dp阿是sp,边距和布局之类的才用dp的,问我为啥写dp,因为我老师给我讲的我忘了....  言归正传,请看下一标题。

输入框控件<EditText>:

这个实际上就是用户输入内容的文本框,这个文本框也是可以设置大小的,至于怎么设置去看day_01,设置方法都是一样的,同理他也是可以设置ID和大小的以及文本框的提示语的,是不是感觉很简单,直接Text提示就出来了,想多了,提示语是需要这个语句的android:hint="提示内容",什么什么?在哪里写这个,肯定是在<EditText>标签里啊,还能在哪,当然了也可以设置提示文字的大小,但是记得是单位是sp。

边距:

这就是一个属性,比如这个android:layout_marginLeft="边距多大dp",这个就是左边距,至于右边距,上边距下边距嘛,自己猜,嘿嘿!

持之以恒

下面来看看代码吧

<?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"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="50dp"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerVertical="true"android:layout_marginLeft="20dp"android:background="@drawable/fahui" /><TextViewandroid:layout_centerHorizontal="true"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerInParent="true"android:text="登录"android:textSize="20dp" /></RelativeLayout><RelativeLayoutandroid:orientation="horizontal"android:layout_marginTop="120dp"android:layout_width="match_parent"android:layout_height="50dp"><TextViewandroid:layout_centerVertical="true"android:textColor="#000000"android:text="账号"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:layout_marginLeft="20dp"android:textSize="20dp" /><EditTextandroid:layout_width="match_parent"android:layout_height="60dp"android:layout_gravity="center_vertical"android:layout_marginLeft="80dp"android:layout_marginRight="20dp"android:hint="请输入账号"android:textColor="#000000" />
</RelativeLayout><RelativeLayoutandroid:layout_marginTop="240dp"android:layout_width="match_parent"android:layout_height="50dp"><TextViewandroid:layout_marginTop="120dp"android:layout_centerVertical="true"android:textColor="#000000"android:text="密码"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="20dp"android:textSize="20dp" /><EditTextandroid:layout_width="match_parent"android:layout_height="60sp"android:layout_centerVertical="true"android:layout_marginLeft="80dp"android:layout_marginRight="20dp"android:hint="请输入密码"android:textColor="#000000" /></RelativeLayout><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:layout_centerHorizontal="true"android:layout_marginBottom="80dp"android:orientation="horizontal"><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginRight="100dp"android:background="@drawable/zhifubao" /><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:background="@drawable/weixin" /></LinearLayout></RelativeLayout>
效果图看封面吧

Android Studio_day02 实际应用登录界面相关推荐

  1. android studio 微信登录界面,如何使用Android Studio开发用户登录界面

    满意答案 zhou9081 2016.05.21 采纳率:51%    等级:7 已帮助:411人 如何使用Android Studio开发用户登录界面,具体解决方案如下: 解决方案1: <:t ...

  2. Android studio设计app登录界面

    Android studio设计app登录界面 UI界面设计 在设计登录界面时,可以使用不同布局方式来实现该功能,通常情况下使用的是LinearLayout(线性布局)和TableLayout(表格布 ...

  3. Android实现仿QQ登录界面背景动画效果

    登录QQ的时候,我们会看到在登录界面的背景不是静态的,而是一段动画效果,刚开始觉得蛮好奇的,现在我们也来实现一下这种效果,实现起来还是挺简单的. 实现步骤: 1.自定义CustomVideoView类 ...

  4. android自动登录简书,Android开发之简单登录界面

    用户界面基础 Android系统的四大组件分别是活动(Activity).服务(Service).广播接收器(Broadcast Receiver).内容提供器(Content Provider). ...

  5. [Android学习] 1. 简易登录界面设计

    通过对活动及控件的学习,今天制作一个简易登录界面.简要记录一下操作过程.遇到的问题及学到的经验,希望各位老师多多提出问题不吝赐教! 预期设计效果图  设计要求: 1.布局不限,参考上图: 2.利用Ed ...

  6. Android基本布局和登录界面的设计

    设计登录界面是我们最先接触的时候基本都要涉及到的一个过程,这之前我们先把基本的只是介绍一下,这里我们借鉴了一些其他博主的介绍. 主要内容     1.EditText 概述:文本编辑框控件,继承自Te ...

  7. 手机版(兼容android和ios)用户登录界面H5

    本文主要是开发的一个手机版(兼容android和ios)的商城登录页面. 1.接下来直接上HTML的代码 <!DOCTYPE html> <html> <head> ...

  8. Android studio制作QQ登录界面

    (1)需要一张图片作为QQ头像,因此先找一张图片(png格式)放到drawable文件夹中. (2)分析界面组成部分,整体来看界面分三个部分 第一部分:放置一个lmageView控件用于 显示头像: ...

  9. Android水果超市的登录界面,【水果识别】自助水果超市matlab源码含 GUI

    一.简介 基于matlab自助水果超市 二.源代码 function varargout = rmbbb(varargin) % RMBBB MATLAB code for rmbbb.fig % R ...

最新文章

  1. 深入jvm学习(1)--体系结构
  2. 转载-让PIP源使用国内镜像,提升下载速度和安装成功率
  3. presto spill to disk
  4. 检测输入路径是否存在错误_为什么存在用户输入错误
  5. 你知道长颈鹿是怎么睡觉的吗? | 今日趣图
  6. jQuery 入门教程(5): 显示/隐藏内容
  7. java+向前进一_Java 线程基础
  8. Prometheus 监控Mysql服务器及Grafana可视化
  9. java接口自动化demo_第一个java 接口自动化程序
  10. python数据论文_如何利用Python绘制学术论文图表
  11. 空间数据共享与交换技术现状
  12. svn服务器记录日志文件,svn服务器日志时间设置
  13. sp_help 查看表结构 alter column修改字段长度
  14. 设计模式(Design Patterns)
  15. 【手写数字识别】基于matlab知识库手写体数字识别【含Matlab源码 311期】
  16. 2011通信展:应用为王 国内3G终端企业集体发力
  17. android T 前台Service
  18. 2021年2月28日【Jiawei_Z】Ethercat的整个实现过程(举例:Lan9252)
  19. Office办公 WPS如何设置页边距
  20. 如何恢复计算机我的电脑工具栏,我的电脑工具栏不见了,怎样恢復

热门文章

  1. LiveData的简介
  2. 《非暴力沟通两性篇》读书笔记
  3. Elasticsearch(二)IK中文分词器
  4. 服务器相关 HTTP 请求错误
  5. python编程入门书-最适合Python初学者的6本书籍推荐「必须收藏」
  6. 初学编程者开始Revit 二次开发自学教程
  7. nginx安装配置 linux
  8. 计算机用户被禁用,administrator账户被停用怎么办【图文教程】
  9. JSONAjax(语法格式+解析json)
  10. 错误 1error LNK1207 PDB 格式不兼容;请删除并重新生成