当前位置:网站首页>ConstraintLayout布局
ConstraintLayout布局
2022-04-23 10:58:00 【Tenero-Forever】
- 在API9以上的Android操作系统中使用,主要是为了解决布局嵌套过多的问题而出现,以灵活的方式定位调整小部件。
- 从Android2.3起,官方模板默认使用约束布局
- constraintLayout和RelaiveLaout类似,采用相对定位的布局模式。
- 约束布局灵活性更高,且可以按照比例约束空间位置和尺寸,能更好适应屏幕大小不同的机型
基线定位
文本基线,文本对齐
两个textview空间高度不一致希望文本对齐可以使用基线定位
角度定位
边距定位
在ConstraintLayout里面实现边距定位,必须先约束相应控件在约束布局里的位置,否则将不生效(margin布局只对其相约束的view起作用)
链定位
约束布局中的控件排列方式就像一条链,链中的每一环是一个控件。
版权声明
本文为[Tenero-Forever]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_55355282/article/details/124308089
边栏推荐
- Strongest date regular expression
- HuggingFace
- Notes on concurrent programming of vegetables (IX) asynchronous IO to realize concurrent crawler acceleration
- 主流手机分辨率与尺寸
- Embedded related surface (I)
- Go interface usage
- Gets the current time in character format
- Promise详解
- Visualized common drawing (II) line chart
- Let the LAN group use the remote device
猜你喜欢
Swagger2 自定义参数注解如何不显示
Comparison and practice of prototype design of knowledge service app
Go interface usage
VIM + ctags + cscope development environment construction guide
《Neo4j权威指南》简介,求伯君、周鸿袆、胡晓峰、周涛等大咖隆重推荐
Deploy jar package
C language - custom type
使用zerotier让异地设备组局域网
Learning note 5 - gradient explosion and gradient disappearance (k-fold cross verification)
比深度学习更值得信赖的模型ART
随机推荐
图像处理——噪声小记
Code implementation of general bubbling, selection, insertion, hill and quick sorting
JDBC – PreparedStatement – 如何设置 Null 值?
【leetcode】102.二叉树的层序遍历
C语言之结构体(进阶篇)
Ueditor -- limitation of 4m size of image upload component
Dirichlet prefix sum (number theory optimization formula sub complexity weapon)
【leetcode】199. Right view of binary tree
Typora operation skill description (I)
得到知识服务app原型设计比较与实践
Let the LAN group use the remote device
最强日期正则表达式
Embedded related surface (I)
全栈交叉编译X86完成过程经验分享
任意文件读取漏洞 利用指南
SQL server query database deadlock
The difference between restful and soap
Latex usage
SWAT—Samba WEB管理工具介绍
GO接口使用