目录
ConstraintLayout
1.父布局约束<子控件位于布局中的什么位置默认绘制在左上角>
layout_constraintLeft_toLeftOf约束子View左对齐
layout_constraintRight_toRightOf约束子View右对齐
2.子View相对约束<控件相对于其他控件的位置 >
layout_constraintLeft_toRightOf(其他位置类似)相对于其他子View的位置
3.圆形约束<使用圆的方式设置边上的控件相对于圆心控件的位置>
layout_constraintCircle圆心子View
layout_constraintCircleRadius圆形半径
layout_constraintAngle定位角度
4.百分比约束<通过百分比的方式约束子控件的长宽>
控件宽高设置为0dp
设置控件的父布局约束
设置默认宽高为为父布局的宽高(layout_constraintWidth_default="percent",1.1-beta1和1.1-beta2中是必需的)
设置宽高所占的百分比(layout_constraintWidth_percent="0.5")
注意:强制限制生成的控件大小,不遵循自适应的设置宽高可以使用layout_constrainedWidth =“true | false”
5.子控件的宽高比
设置宽高至少一个为0dp
layout_constraintDimensionRatio="1:1"(浮点值,