当前位置: 首页 > news >正文

网站强制使用极速模式ppt超级市场

网站强制使用极速模式,ppt超级市场,asp网站开发报告,哪个网站可以看免费的电视剧三三要成为安卓糕手 零:需求引入实现设计图中的效果,具体要求如下: 不管是根布局,还是其他登录方式时的嵌套布局,只能使用LinearLayout;根布局:背景为白色、上下左右内边距16dp;跳过按钮&#x…

在这里插入图片描述

三三要成为安卓糕手

零:需求引入

  1. 实现设计图中的效果,具体要求如下:

    1. 不管是根布局,还是其他登录方式时的嵌套布局,只能使用LinearLayout;
    2. 根布局:背景为白色、上下左右内边距16dp;
    3. 跳过按钮:在布局的右侧;
    4. 红色大logo:居中显示、上下外边距为30dp、引用图片在素材当中自行获取;
    5. 用户名标签:底部外边距8dp;
    6. 用户名输入框:宽度跟随父布局、高度自适应、提示“请输入用户名”、输入类型为textPersonName;
    7. 密码标签:顶部外边距16dp、底部外边距8dp;
    8. 密码输入框:宽度跟随父布局、高度自适应、提示“请输入密码”、输入类型为textPassword;
    9. 登录按钮:顶部外边距16dp、宽度跟随父布局、高度自适应、居中显示;
    10. 其他登录方式标签:顶部外边距32dp、文本颜色为#808080;
    11. 3种登录方式使用LinearLayout嵌套,父布局顶部外边距16dp、宽度跟随父布局、高度自适应;
    12. 3种登录方式:宽度平均分配父布局宽度、高度60dp;
    13. 使用xml的形式实现完后,学有余力再使用Java的方式实现一遍;

一:总体代码

<?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"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/main"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".layout.RelativeLayout"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentEnd="true"android:text="跳过" /><ImageViewandroid:id="@+id/iv_logo"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_centerHorizontal="true"android:layout_marginTop="30dp"android:layout_marginBottom="30dp"android:src="@drawable/icon_logo" /><TextViewandroid:id="@+id/tv_user_name"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@+id/iv_logo"android:text="用户名:" /><EditTextandroid:id="@+id/et_user_name"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/tv_user_name"android:hint="请输入童哥的姓名"android:inputType="textPersonName" /><TextViewandroid:id="@+id/tv_password"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@+id/et_user_name"android:text="密码:" /><EditTextandroid:id="@+id/et_password"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/tv_password"android:hint="请输入童哥的学习资料密码"android:inputType="textPassword" /><Buttonandroid:id="@+id/btn_login"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@+id/et_password"android:layout_marginTop="20dp"android:text="登录" /><TextViewandroid:id="@+id/tv_other"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@+id/btn_login"android:layout_marginTop="30dp"android:text="其它登录方式" /><ImageViewandroid:id="@+id/iv_wechat"android:layout_width="60dp"android:layout_height="60dp"android:layout_alignBottom="@+id/iv_qq"android:layout_marginLeft="16dp"android:src="@drawable/icon_wechat" /><!--    想让qq的图标既居中,又靠着微信,qq作为一个基点--><ImageViewandroid:id="@id/iv_qq"android:layout_width="60dp"android:layout_height="60dp"android:layout_below="@+id/tv_other"android:layout_centerHorizontal="true"android:layout_marginTop="20dp"android:src="@drawable/icon_qq" /><ImageViewandroid:id="@+id/iv_weibo"android:layout_width="60dp"android:layout_height="60dp"android:layout_alignBottom="@id/iv_qq"android:layout_alignParentEnd="true"android:layout_marginRight="16dp"android:src="@drawable/icon_weibo" /></RelativeLayout>

二:效果

我们设置的30dp参数在不同分辨率的手机上可能大小不同,有些屏幕是2k,1k,4k不尽相同

在这里插入图片描述

三:代码分析

1:与父布局对齐

align [əˈlaɪn]对齐

这两句代码是等价的,相对于父布局靠右

android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"

这两句代码是等价的,相对于父布局靠左

		android:layout_alignParentBottom="true"android:layout_alignParentLeft="true"

总共有6个属性,慢慢了解吧

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

属性对齐依据适用场景
layout_alignParentRight固定物理右侧,不受语言阅读方向影响需严格固定在父容器右侧,不考虑 RTL 排版的场景
layout_alignParentEnd随语言阅读方向变化(LTR 时为右,RTL 时为左 )国际化 App,需适配从右往左阅读语言(如阿拉伯语)的场景

2:水平和垂直居中

		android:layout_centerHorizontal="true"    //水平居中android:layout_centerInParent="true"	//水平和垂直方向都居中

3:textPersonName 的作用

告诉系统当前输入框用于输入人名(如姓名、用户名等)

4:相对控件方向-在上或下面

android:layout_above="@+id/et_password"  //在谁上面
android:layout_below="@+id/et_password"  //在谁下面

5:layout_alignBottom 的作用

当前视图的底部会和 iv_qq 视图的底部处于同一水平线上。

android:layout_alignBottom="@+id/iv_qq"

四:总结

关键的常用方法

layout_below=其它控件id 咋哪个空间下面

layout_alignBottom=其它控件id 底部对齐

layout_marginLeft=30dp 设置边距

layout_alignParentEnd=true 和 Start

layout_centerHorizontal 水平居中

http://www.dtcms.com/a/412351.html

相关文章:

  • 17.zwd一起做网站池尾站安卓下载软件app
  • qq自动发货平台网站怎么做wordpress动态文章页模板下载
  • 龙芯在启动参数里添加串口信息
  • 网站域名spacewordpress 打开很慢
  • 收到短信说备案被退回但工信部网站上正常啊wordpress自动缩略图
  • 目前做网站最流行的程序语言网站出问题
  • 上海网站营销seo怎么查看网站是哪个公司建的
  • Stata语法详解:从入门到精通
  • 专门做当归的网站网站文章不收录怎么做
  • 正规网站建设服务中心开发企业app公司
  • 新手搭建做网站简洁型网页
  • 深度学习------专题《图像处理项目》
  • 阿里云iis放网站织梦系统怎么做单页网站
  • 企业网站推广 知乎wordpress媒体库在哪
  • 关于红黑树删除节点操作的完整推导
  • 深圳做网站报价 网站
  • git reset --soft <commit>和 git revert <commit>的区别
  • Unity-角色控制器
  • 比价网站源码网站关键词优化方法
  • 模板网站的域名是什么意思网络服务器租赁
  • Linux第二十一讲:网络层
  • 【FreeRTOS】第七课(3):任务间的通信——使用队列集优化程序架构
  • SQL语句详细使用说明 - 适合小白入门
  • 天水网站建设惠普网站暂时关闭 seo
  • 做网站如何对接支付gpu服务器租用价格
  • 检查一个字符串是否包含所有长度为K的二进制子串
  • 做网站需要多少空间芜湖网站建设兼职
  • 森动网网站建设好吗自己开发app要钱吗
  • 携程网站建设在阿里巴巴上做网站需要什么条件
  • 北京建设部网站职称网站建设硬件投入表