小智 16

立场观点 - 偏见

bias:(约束区域大小-视图大小)分布比例。

应用程序:layout_constraintHorizo​​ntal_bias =“0~1”

0:附加到左侧

1:连接到右侧

0.5:居中(默认)

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="button1"
    app:layout_constraintHorizontal_bias="0"
    ... />
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="button2"
    app:layout_constraintHorizontal_bias="1"
    ... />
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述