约束布局 v1.1.0:layout_constraintHorizontal_weight = 0 不再工作
Constraint Layout v1.1.0: layout_constraintHorizontal_weight = 0 not working anymore
如果视图progress_remaining的权重(layout_constraintHorizontal_weight)为0,progress的权重为1 它没有像以前那样工作(和预期的一样)。
权重为 1 的视图 progress 的宽度为 0,而权重为 0 的 progress_remaining 接管所有 space。
0.0001 和 1 一切看起来都很好。
此问题发生在约束布局 v1.1.0(之前使用 v1.0.2)
我错过了什么吗?错误?
谢谢。
示例:
<View
android:id="@+id/progress"
android:layout_width="0dp"
android:layout_height="3dp"
android:background="@color/blue"
app:layout_constraintBottom_toBottomOf="@+id/header_image"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/progress_remaining"/>
<View
android:id="@+id/progress_remaining"
android:layout_width="0dp"
android:layout_height="3dp"
android:background="@color/red"
app:layout_constraintBottom_toBottomOf="@+id/header_image"
app:layout_constraintHorizontal_weight="0"
app:layout_constraintLeft_toRightOf="@+id/progress"
app:layout_constraintRight_toRightOf="parent"/>
2 2018 年 6 月 4 日11:19PM
标记为固定
已在 1.1.1
中修复
如果视图progress_remaining的权重(layout_constraintHorizontal_weight)为0,progress的权重为1 它没有像以前那样工作(和预期的一样)。
权重为 1 的视图 progress 的宽度为 0,而权重为 0 的 progress_remaining 接管所有 space。
0.0001 和 1 一切看起来都很好。
此问题发生在约束布局 v1.1.0(之前使用 v1.0.2)
我错过了什么吗?错误?
谢谢。
示例:
<View
android:id="@+id/progress"
android:layout_width="0dp"
android:layout_height="3dp"
android:background="@color/blue"
app:layout_constraintBottom_toBottomOf="@+id/header_image"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/progress_remaining"/>
<View
android:id="@+id/progress_remaining"
android:layout_width="0dp"
android:layout_height="3dp"
android:background="@color/red"
app:layout_constraintBottom_toBottomOf="@+id/header_image"
app:layout_constraintHorizontal_weight="0"
app:layout_constraintLeft_toRightOf="@+id/progress"
app:layout_constraintRight_toRightOf="parent"/>
2 2018 年 6 月 4 日11:19PM
标记为固定 已在 1.1.1
中修复