ConstraintLayout 佈局屬性詳解

app:layout_constraintLeft_toLeftOf

表示此控件的左邊框與某個控件的左邊框對齊或者在其右邊

app:layout_constraintLeft_toRightOf

表示此控件的左邊框與某個控件的右邊框對齊或者在其右邊

app:layout_constraintRight_toLeftOf

表示此控件的右邊框與某個控件的左邊框對齊或在其左邊

app:layout_constraintRight_toRightOf

表示此控件的右邊框與某個控件的右邊框對齊或在其左邊

app:layout_constraintTop_toTopOf

表示此控件的頂部邊框與某個控件的頂部邊框水平對齊或在其下邊

app:layout_constraintTop_toBottomOf

表示此控件的頂部邊框與某個控件的底部邊框水平對齊或在其下邊

app:layout_constraintBottom_toTopOf

表示此控件的底部邊框與某個控件的頂部邊框水平對齊或其上邊

app:layout_constraintBottom_toBottomOf

表示此控件的底部邊框與某個控件的底部邊框水平對齊或其上邊

app:layout_constraintBaseline_toBaselineOf

表示此控件與某個控件水平對齊

app:layout_editor_absoluteX

表示此控件在佈局中X軸的絕對座標點。

app:layout_editor_absoluteY

表示此控件在佈局中Y軸的絕對座標點

app:layout_constraintGuide_begin

表示在佈局中引導線距頂部或左邊框的距離(如:20dp表示距頂部或者左邊框20dp)

app:layout_constraintGuide_end

表示在佈局中引導線距底部的距離(如:10dp表示距頂部10dp)

app:layout_constraintGuide_percent

表示在整個佈局中引導線距離左邊框的百分百(如:app:layout_constraintGuide_percent=”0.5”表示距離左邊框50%的位置)

app:layout_constraintStart_toEndOf

表示此控件的左邊界在某個控件右邊界的右邊,及表示此控件在某個控件的右邊

app:layout_constraintStart_toStartOf

表示此控件的左邊界與某個控件的左邊界在同一垂直線上

app:layout_constraintEnd_toStartOf

表示此控件的右邊界與某個控件的左邊界在同一垂直線上

app:layout_constraintEnd_toEndOf

表示此控件的右邊界與某個控件的右邊界對齊

app:layout_constraintHorizontal_bias

表示此控件在佈局中的水平方向上的偏移百分百。

app:layout_constraintVertical_bias

表示此控件在佈局中的的垂直方向上的偏移百分百。如視圖16,代碼16

app:layout_constraintDimensionRatio

表示兩個控件的縱橫比,而使用則需要把寬(layout_width)或者高(layout_height)設置爲0dp,根據另一個屬性和比例, 計算當前屬性, 如兩個圖片控件的顯示大小,app:layout_constraintDimensionRatio=”4:3”;

app:layout_goneMarginLeft
//The left margin to use when the target is gone.

app:layout_goneMarginTop
//The top margin to use when the target is gone.

app:layout_goneMarginRight
//The right margin to use when the target is gone

app:layout_goneMarginBottom
//The bottom margin to use when the target is gone.

app:layout_goneMarginStart
//The start margin to use when the target is gone.

app:layout_goneMarginEnd
//The end margin to use when the target is gone.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章