gpt4 book ai didi

android - 约束布局 v1.1.0 : layout_constraintHorizontal_weight = 0 not working anymore

转载 作者:太空狗 更新时间:2023-10-29 13:48:28 24 4
gpt4 key购买 nike

如果 View progress_remaining 的权重 (layout_constraintHorizo​​ntal_weight) 为 0 而 progress 的权重为 1,则它没有像以前(和预期的那样)工作。

权重为 1 的 View progress 的宽度为 0,而权重为 0 的 progress_remaining 占据了所有空间。

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:19

标记为固定在 1.1.1 中修复

https://issuetracker.google.com/issues/80149154

关于android - 约束布局 v1.1.0 : layout_constraintHorizontal_weight = 0 not working anymore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50466741/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com