Reputation: 12135
I have an ImageView setup like this
<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" />
with
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
it looks like this
but with
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
ImageView is not visible
Update
Version 2.0.3 it's still not fixed, it only works if you don't set dp for height (e.g. you set wrap_content
instead) and app:layout_constraintEnd_toEndOf=
is also required, but it works then differently, I need to set height in DPI! It worked like this in 2.0.1 and app:layout_constraintEnd_toEndOf=
wasn't required to be set
Upvotes: 4
Views: 540
Reputation: 54194
It looks like this is a known issue: https://issuetracker.google.com/issues/170313444
The recommended workaround is to add this to your ConstraintLayout
tag:
app:layout_optimizationLevel="cache_measures"
Upvotes: 3