当前位置:网站首页>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
边栏推荐
猜你喜欢
Comparison and practice of prototype design of knowledge service app
Charles 功能介绍和使用教程
精彩回顾 | DEEPNOVA x Iceberg Meetup Online《基于Iceberg打造实时数据湖》
Cve-2019-0708 vulnerability exploitation of secondary vocational network security 2022 national competition
26. 删除有序数组中的重复项
SQL Server recursive query of superior and subordinate
How can swagger2 custom parameter annotations not be displayed
Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)
Visual solutions to common problems (VIII) mathematical formulas
【leetcode】107. Sequence traversal of binary tree II
随机推荐
一个微博数据库设计带来的简单思考
web三大组件(Servlet,Filter,Listener)
SWAT - Introduction to Samba web management tool
Visual Road (XII) detailed explanation of collection class
解决方案架构师的小锦囊 - 架构图的 5 种类型
MBA-day6 逻辑学-假言推理练习题
Comparison and practice of prototype design of knowledge service app
高价买来的课程,公开了!phper资料分享
GO接口使用
MBA-day5数学-应用题-工程问题
闹钟场景识别
精彩回顾 | DEEPNOVA x Iceberg Meetup Online《基于Iceberg打造实时数据湖》
Leetcode22: bracket generation
Mba-day6 logic - hypothetical reasoning exercises
【leetcode】102. Sequence traversal of binary tree
How to quickly download vscode
Visual common drawing (IV) histogram
SQL Server cursor circular table data
第六站神京门户-------手机号码的转换
Let the LAN group use the remote device