Open OleksandrKucherenko opened 7 years ago
There seems to be no problem
In IDE it displayed correctly, but on device it fails.
instead of View
use a custom view
, and in it trace calls of onMeasure
and it parameters. Problem is easy to reproduce.
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/ep_pink"
app:layout_constraintTop_toTopOf="@+id/guideline_top"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>
Expected:
Reality:
Potentially there are several problems:
app:layout_constraintDimensionRatio="w,1:1"
instead of width should be set height