Obsolete
Status Update
Comments
ni...@google.com <ni...@google.com> #2
Going through various old bugs and came across this; I've added a unit test to confirm that this works now so it was fixed a while back.
ni...@google.com <ni...@google.com>
54...@gmail.com <54...@gmail.com> #7
sorry, 2.1.0-beta01 it's not fixed,
<ImageView
android:id="@+id/carIv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="4dp"
app:layout_constraintDimensionRatio="h,156:92"
app:layout_constraintEnd_toStartOf="@id/plateIv"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
and 1.1.3 is work perfect
<ImageView
android:id="@+id/carIv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="4dp"
app:layout_constraintDimensionRatio="h,156:92"
app:layout_constraintEnd_toStartOf="@id/plateIv"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
and 1.1.3 is work perfect
ni...@google.com <ni...@google.com>
ni...@google.com <ni...@google.com> #8
#7, this seems to work as intended -- a ratio of 156:92 (W:H) -- plus, in that example the height is only constrained with a top constraint so the ratio has to be based on the dimension set by the width. What was the result you expected?
ni...@google.com <ni...@google.com>
ho...@google.com <ho...@google.com> #9
If this is still an issue please create a new bug.
he...@jppol.dk <he...@jppol.dk> #10
I am not able to reproduce the issue with 2.1.0.
Thank you.
Thank you.
Description
Version used: 2.0.2
Theme used: Tried with both Theme.AppCompat.Light.DarkActionBar and Theme.AppCompat.Light
Devices/Android versions reproduced on: Any including Android Studio
- Relevant code to trigger the issue.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="
xmlns:app="
xmlns:tools="
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textview"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@+id/imageview"
app:layout_constraintStart_toEndOf="@+id/imageview"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="This is a test 1234..." />
<ImageView
android:id="@+id/imageview"
android:layout_width="125dp"
android:layout_height="0dp"
android:adjustViewBounds="false"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="h,16:9"
app:layout_constraintStart_toEndOf="@id/textview"
app:layout_constraintTop_toTopOf="@+id/textview"
tools:ignore="ContentDescription"
tools:srcCompat="@tools:sample/backgrounds/scenic" />
</androidx.constraintlayout.widget.ConstraintLayout>
- A screenrecord or screenshots showing the issue (if UI related).
It worked with all ConstraintLayout versions before 2.0.2
No matter what value is set for layout_constraintDimensionRatio, is it not respected.
See screenshots from 2.0.1 and 2.0.2