基础的都不用介绍了
app:layout_constraintLeft_toLeftOf
app:layout_constraintRight_toRightOf
app:layout_constraintTop_toTopOf
app:layout_constraintTop_toBottomOf
app:layout_constraintBottom_toBottomOf
............................
重点介绍以下
这里面有两个写法,高度h, 宽度为w, 1:1 =宽高比例
app:layout_constraintDimensionRatio ="h,1:1"(前提是 android:layout_height="0dp",android:layout_width="match_parent")
h ,1;1-> 高度是宽度1倍 换算方式等同于 h=w(1/1)
h,1;2->高度是宽度2倍 换算方式等同于 h=w(2/1)
app:layout_constraintDimensionRatio ="w1:1"(前提是 android:layout_width="0dp", android:layout_height="0dp")
w ,1:1-> 宽度是高度1倍 换算方式等同于 w=h(1/1)
w,1:2->宽度是高度1/2倍 换算方式等同于 w=h(1/2)
下面是 权重比)
app:layout_constraintVertical_weight(竖向)(必须左右都有LeftOf \RightOf)
app:layout_constraintHorizontal_weight(横向)(必须左右都有LeftOf \ RightOf)
否则不生效