ConstraintLayout (约束布局)属性详情

1、app:layout_constraintLeft_toLeftOf
//Constrains the left side of a child to the left side of a target child (contains the target child id).
表示此控件的左边框与某个控件的左边框对齐或者在其右边
在这里插入图片描述

2、app:layout_constraintLeft_toRightOf
//Constrains the left side of a child to the right side of a target child (contains the target child id).
表示此控件的左边框与某个控件的右边框对齐或者在其右边
在这里插入图片描述

3、app:layout_constraintRight_toLeftOf
//Constrains the right side of a child to the left side of a target child (contains the target child id).
表示此控件的右边框与某个控件的左边框对齐或在其左边

在这里插入图片描述

4、app:layout_constraintRight_toRightOf
//Constrains the right side of a child to the right side of a target child (contains the target child id).
表示此控件的右边框与某个控件的右边框对齐或在其左边

在这里插入图片描述

5、app:layout_constraintTop_toTopOf
//Constrains the top side of a child to the top side of a target child (contains the target child id).
表示此控件的顶部边框与某个控件的顶部边框水平对齐或在其下边

在这里插入图片描述

6、app:layout_constraintTop_toBottomOf
//Constrains the top side of a child to the bottom side of a target child (contains the target child id).
表示此控件的顶部边框与某个控件的底部边框水平对齐或在其下边

在这里插入图片描述

7、app:layout_constraintBottom_toTopOf
//Constrains the bottom side of a child to the top side of a target child (contains the target child id).
表示此控件的底部边框与某个控件的顶部边框水平对齐或其上边

在这里插入图片描述

8、app:layout_constraintBottom_toBottomOf
//Constrains the bottom side of a child to the bottom side of a target child (contains the target child id).
表示此控件的底部边框与某个控件的底部边框水平对齐或其上边

在这里插入图片描述

9、app:layout_constraintBaseline_toBaselineOf
//Constrains the baseline of a child to the baseline of a target child (contains the target child id).
表示此控件与某个控件水平对齐

在这里插入图片描述

还有其它的一些属性
app:layout_constraintStart_toEndOf
意思就是 Button 的开始部分(从左往右看,开始部分就是 Button 的左边)与 ImageView 的右边是对齐的。
app:layout_constraintStart_toStartOf 这个就是说 Button 的左边与 ImageView 的左边是对齐的 不知道为什么上面已经出的属性能够满足布局需要了,为什么还要再出 start 和 end 的。