I have a parent ConstraintLayout
in my fragment.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="400dp"
android:maxHeight="400dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorPopupBackground"
android:fadeScrollbars="false"
android:id="@+id/profile_layout"
android:elevation="1dp">
as you can see i've set a maxHeight
and constrained it on every side - so you would think it should centre vertically on the screen. However the ConstraintLayout
sits on the top vertically.
Any idea?