Trying to spread elelements evenly vertically to screen edge. Yellow and red sections have min and max height, it depends of green section size, and it works good. Problems comes when I try to change the test views in this example with for instance Button, or FrameLayout: this widgets always stay at layout_constraintHeight_min value and never expand to theirs max height. Any thoughts?
<androidx.constraintlayout.widget.ConstraintLayout>
<View
android:id="@+id/view0"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#A70"
app:layout_constraintHeight_min="100dp"
app:layout_constraintHeight_max="200dp"
app:layout_constraintHeight_default="wrap"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/guidelineMain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/bar0"/>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/bar0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="view0"/>
<View
android:id="@+id/view1"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#A00"
android:orientation="vertical"
app:layout_constraintHeight_min="100dp"
app:layout_constraintHeight_max="200dp"
app:layout_constraintHeight_default="wrap"
app:layout_constraintTop_toTopOf="@id/bar0"
app:layout_constraintStart_toStartOf="@id/guidelineMain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/bar1"/>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/bar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="view1"/>
<View
android:id="@+id/view2"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#00A"
app:layout_constraintHeight_min="50dp"
app:layout_constraintTop_toBottomOf="@id/bar1"
app:layout_constraintStart_toStartOf="@id/guidelineMain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/bar2"/>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/bar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="view2"/>
<View
android:id="@+id/view3"
android:layout_width="0dp"
android:layout_height="300dp"
android:background="#0a0"
app:layout_constraintTop_toBottomOf="@id/bar2"
app:layout_constraintStart_toStartOf="@id/guidelineMain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
