当前位置:网站首页>Android screen adaptation (using constraintlayout), kotlin array sorting
Android screen adaptation (using constraintlayout), kotlin array sorting
2022-07-01 07:46:00 【m0_ sixty-six million two hundred and sixty-four thousand six h】
The tutorial is as follows :
1. Pull two transverse reference lines and set them at 20%,65%( Calculated by bloggers )

2. Then pull one imageView Enter layout , Select the picture you want to display

3. Put this imageView The upper and lower references are set as two reference lines , And set the left and right references as the parent container . Set its width to wrap_content, High set to mach_constraint( That is to say 0dp).
This picture fits the position .
Empathy : Fit the second picture
New two lines , Set the positions of the two lines at %89,%93.5.
Pull one imageView Enter layout , Select the picture you want to display
Put this imageView The upper and lower references are set as two reference lines , And set the left and right references as the parent container . Set its width to wrap_content, High set to mach_constraint( That is to say 0dp).
Last : by ConstraintLayout The layout sets a background

The operation effect pictures of the two mobile phones and tablets are as follows

xml The code is as follows
<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout 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:layout_width=“wrap_content”
android:layout_height=“match_parent”
android:background="@drawable/splash_bg"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline1"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:orientation=“horizontal”
app:layout_constraintGuide_percent=“0.65” />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:orientation=“horizontal”
app:layout_constraintGuide_percent=“0.2” />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:orientation=“horizontal”
app:layout_constraintGuide_percent=“0.89” />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:orientation=“horizontal”
app:layout_constraintGuide_percent=“0.935” />
<ImageView
android:id="@+id/imageView"
android:layout_width=“wrap_content”
android:layout_height=“0dp”
summary
Finally, Xiaobian wants to say : No matter what direction you choose in the future , What's important at the moment is to Android We should learn the technology well , After all, for programmers , What to learn 、 There's too much technology , If you want not to be eliminated by the environment, you have to constantly improve yourself , It's always us to adapt to the environment , Not the environment to adapt us !
Here are dozens of sets of Tencent that I sorted out 、 Bytes to beat , JD.COM , millet , headlines 、 Ali 、 Meituan and other companies 19 Year of Android Interview questions . Put the technical points into video and PDF( In fact, it took a lot more energy than expected ), Contains the context of knowledge + A lot of details .
Due to limited space , Here's a small part of it in the form of pictures .

Detailed arrangement in GitHub You can see ;
Android Architecture video +BAT Interview topics PDF+ Learning notes
Online learning Android A lot of information , But if the knowledge learned is not systematic , When you encounter a problem, you just have a taste of it , No further study , So it's hard to really improve the technology . I hope this systematic technical system has a direction reference for you .
E8%AF%95%E6%8B%BF%E9%AB%98%E8%96%AA%EF%BC%81.md)**
Online learning Android A lot of information , But if the knowledge learned is not systematic , When you encounter a problem, you just have a taste of it , No further study , So it's hard to really improve the technology . I hope this systematic technical system has a direction reference for you .
It's a long way to go , Let's encourage together ~
边栏推荐
- matlab保存DB4i深度相机图片
- Stepsister becomes stepmother, son breaks off relationship with himself, and musk, the world's richest man, why is it so miserable?
- 漏刻有时API接口实战开发系列(14):身份证实名鉴权验证
- vscode 根据 ESLint 规范自动格式化代码
- 038 network security JS
- 【技能】创建.bat快速打开网页
- Eigen矩阵运算库快速上手
- 2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作
- 【mysql学习笔记25】sql语句优化
- Oracle create auto increment ID
猜你喜欢

Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money

赌上了绩效,赢了公司CTO,我要搭DevOps平台!

Browser local storage

2022 mobile crane driver test exercises and online simulation test

Wang Yingqi, founder of ones, talks to fortune (Chinese version): is there any excellent software in China?

2022年流动式起重机司机考试练习题及在线模拟考试

2022广东省安全员A证第三批(主要负责人)特种作业证考试题库模拟考试平台操作

如何让两融交易更极速

下载Xshell和Xftp
![[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario](/img/10/ed857892d2e0ea72e100a4008e6d69.png)
[recommendation system] breakthrough and imagination of deep location interactive network dpin for meituan takeout recommendation scenario
随机推荐
Todolist classic case ①
ctfshow-web351(SSRF)
熱烈祝賀五行和合酒成功掛牌
LeetCode+ 71 - 75
Caesar
2022 electrician (intermediate) recurrent training question bank and answers
Alibaba OSS postman invalid according to policy: policy condition failed: ["starts with", "key", "test/"]
Minecraft 1.16.5 module development (51) tile entity
Subclasses call methods and properties of the parent class with the same name
【编程强训3】字符串中找出连续最长的数字串+数组中出现次数超过一半的数字
Jax's deep learning and scientific computing
【目标检测】目标检测界的扛把子YOLOv5(原理详解+修炼指南)
How to make the two financial transactions faster
Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
Custom events of components ②
【Flutter 问题系列第 72 篇】在 Flutter 中使用 Camera 插件拍的图片被拉伸问题的解决方案
Those high-frequency written tests and interview questions in [Jianzhi offer & Niuke 101] - linked list
【编程强训2】排序子序列+倒置字符串
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
redisson使用全解——redisson官方文檔+注釋(上篇)