Android 在2.0.2版本中,约束布局及其“尺寸比”属性发生了什么变化?

Android 在2.0.2版本中,约束布局及其“尺寸比”属性发生了什么变化?,android,android-constraintlayout,Android,Android Constraintlayout,我有一个像这样的ImageView设置 <ImageView android:layout_width="0dp" android:layout_height="@dimen/video_file_item_image_height" android:background="@color/black" app:layout_constraintBottom_toBottomOf="pare

我有一个像这样的ImageView设置

<ImageView
    android:layout_width="0dp"
    android:layout_height="@dimen/video_file_item_image_height"
    android:background="@color/black"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintDimensionRatio="16:9"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
看起来像这样

<ImageView
    android:layout_width="0dp"
    android:layout_height="@dimen/video_file_item_image_height"
    android:background="@color/black"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintDimensionRatio="16:9"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

但是

implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
ImageView不可见

更新


版本2.0.3它仍然没有固定,只有在您没有设置高度dp(例如,您设置了
wrap\u content
)并且
app:layout\u constraintEnd\u toEndOf=
也是必需的情况下,它才能工作,但不同的是,我需要在DPI中设置高度!它在2.0.1中是这样工作的,并且不需要设置
app:layout\u constraintEnd\u toEndOf=
,看起来这是一个已知的问题:

建议的解决方法是将此项添加到您的
ConstraintLayout
标记中:

app:layout_optimizationLevel="cache_measures"

Android Studio的布局检查器显示的是
ImageView
?@Commonware width 0,height 131的大小。如果使用
“W,16:9”
作为值,会发生什么情况?@BenP。我已经试过了,但是没有任何改变。我在Android电视上的应用程序:layout_constraintDimensionRatio=“h,2:3”也有类似的问题,其中肖像图像从底部裁剪。在我将约束布局更新为2.0.1之后,这个问题就出现了,它曾经在1.1.3上工作。上述解决方案对我也没有帮助。令人惊讶的是,同样的布局也适用于移动设备。