Android Studio_day02 实际应用登录界面
序章:
今天做了个登录界面,新学了<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 实际应用登录界面相关推荐
- android studio 微信登录界面,如何使用Android Studio开发用户登录界面
满意答案 zhou9081 2016.05.21 采纳率:51% 等级:7 已帮助:411人 如何使用Android Studio开发用户登录界面,具体解决方案如下: 解决方案1: <:t ...
- Android studio设计app登录界面
Android studio设计app登录界面 UI界面设计 在设计登录界面时,可以使用不同布局方式来实现该功能,通常情况下使用的是LinearLayout(线性布局)和TableLayout(表格布 ...
- Android实现仿QQ登录界面背景动画效果
登录QQ的时候,我们会看到在登录界面的背景不是静态的,而是一段动画效果,刚开始觉得蛮好奇的,现在我们也来实现一下这种效果,实现起来还是挺简单的. 实现步骤: 1.自定义CustomVideoView类 ...
- android自动登录简书,Android开发之简单登录界面
用户界面基础 Android系统的四大组件分别是活动(Activity).服务(Service).广播接收器(Broadcast Receiver).内容提供器(Content Provider). ...
- [Android学习] 1. 简易登录界面设计
通过对活动及控件的学习,今天制作一个简易登录界面.简要记录一下操作过程.遇到的问题及学到的经验,希望各位老师多多提出问题不吝赐教! 预期设计效果图 设计要求: 1.布局不限,参考上图: 2.利用Ed ...
- Android基本布局和登录界面的设计
设计登录界面是我们最先接触的时候基本都要涉及到的一个过程,这之前我们先把基本的只是介绍一下,这里我们借鉴了一些其他博主的介绍. 主要内容 1.EditText 概述:文本编辑框控件,继承自Te ...
- 手机版(兼容android和ios)用户登录界面H5
本文主要是开发的一个手机版(兼容android和ios)的商城登录页面. 1.接下来直接上HTML的代码 <!DOCTYPE html> <html> <head> ...
- Android studio制作QQ登录界面
(1)需要一张图片作为QQ头像,因此先找一张图片(png格式)放到drawable文件夹中. (2)分析界面组成部分,整体来看界面分三个部分 第一部分:放置一个lmageView控件用于 显示头像: ...
- Android水果超市的登录界面,【水果识别】自助水果超市matlab源码含 GUI
一.简介 基于matlab自助水果超市 二.源代码 function varargout = rmbbb(varargin) % RMBBB MATLAB code for rmbbb.fig % R ...
最新文章
- Ubuntu18彻底删除MySQL5.7数据库
- LVI:激光雷达子系统的特征提取梳理
- 听说你还没学Spring就被源码编译劝退了?30+张图带你玩转Spring编译
- 越不服务器显示异常什么原因,计算机异常问题都有哪些常见类型
- ORACLE8的分区管理
- javax.jdo.JDODataStoreException: Required table missing : “`VERSION`“ in Catalog ““ Schema ““.
- C语言嵌入式系统编程修炼之四:屏幕操作
- MySQL的ODBC安装错误问题!
- [SpringSecurity]web权限方案_用户注销
- 转载——逻辑回归的袅娜曲线,你是否会过目难忘?
- NGINX 502 Bad Gateway 用upstream解决方法
- Soul网关源码阅读(九)插件配置加载初探
- windows操作系统下载tomcat,并与eclipse进行整合
- cisco Router专线路由器配置
- Enterprise Library 4.0 - May 2008 发布了
- 集体智慧编程——协同过滤
- (一)流体力学基本概念
- listmanager htdocs
- java算法编程题:计算球的体积
- Spark Steaming流式日志过滤与分析