title: How to adjust constraint layout to scroll view to fit all screen?
body: <p>I have problem in the bottom layout where my constraint layout does not fill the scroll view entirely(blank space bellow). This is the image evidence of the problem.
  In this case I want the gray background to fill that white space below. I tried match parent in everything but it does not work.</p>
  
  <p><a href="https://i.stack.imgur.com/NDQy2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NDQy2.png" alt="enter image description here"></a></p>
  
  <p>This is my xml file that belongs to the layout I uploaded</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/layout"&gt;
  
      &lt;data&gt;
          &lt;variable
              name="viewModel"
              type="com.repsol.repsolmove.ui.login.LoginViewModel" /&gt;
      &lt;/data&gt;
  
  &lt;androidx.constraintlayout.widget.ConstraintLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;androidx.core.widget.NestedScrollView
          android:id="@+id/scrolView"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
              &lt;ImageView
                  android:id="@+id/imageView"
                  android:layout_width="174dp"
                  android:layout_height="70dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="16dp"
                  android:layout_marginEnd="8dp"
                  android:layout_marginBottom="3dp"
                  android:src="@drawable/ic_img_logo_repsolmove"
                  app:layout_constraintBottom_toTopOf="@+id/imageBottomMargin"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
  
              &lt;com.repsol.repsolmove.ui.widgets.RepsolInputLayout
                  android:id="@+id/login"
                  android:layout_width="0dp"
                  android:layout_height="105dp"
                  android:layout_marginTop="30dp"
                  app:errorText="@string/invalid_card_number"
                  app:layout_constraintEnd_toStartOf="@+id/marginEnd"
                  app:layout_constraintStart_toStartOf="@+id/marginStart"
                  app:layout_constraintTop_toBottomOf="@+id/imageView"
                  app:titleText="@string/login_title" /&gt;
  
              &lt;com.repsol.repsolmove.ui.widgets.RepsolInputLayout
                  android:id="@+id/password"
                  android:layout_width="0dp"
                  android:layout_height="105dp"
                  app:errorText="@string/invalid_password"
                  app:isPassword="true"
                  app:layout_constraintEnd_toStartOf="@+id/marginEnd"
                  app:layout_constraintStart_toStartOf="@+id/marginStart"
                  app:layout_constraintTop_toBottomOf="@+id/login"
                  app:titleText="@string/password_title" /&gt;
  
  
              &lt;TextView
                  android:id="@+id/newPassword"
                  style="@style/RepsolText"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="24dp"
                  android:layout_marginEnd="8dp"
                  android:fontFamily="@font/repsol_regular"
                  android:text="@string/new_password"
                  android:textSize="16dp"
                  app:layout_constraintEnd_toStartOf="@+id/marginEnd"
                  app:layout_constraintTop_toBottomOf="@+id/password" /&gt;
  
              &lt;Button
                  android:id="@+id/btnLogin"
                  android:layout_width="228dp"
                  android:layout_height="50dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="32dp"
                  android:layout_marginEnd="8dp"
                  android:background="@drawable/shape_rounded_fill_rectangle"
                  android:fontFamily="@font/repsol_regular"
                  android:text="@string/login"
                  android:textAllCaps="false"
                  android:textColor="@android:color/white"
                  android:textSize="16sp"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toBottomOf="@+id/newPassword" /&gt;
  
              &lt;Button
                  android:id="@+id/btnJoin"
                  android:layout_width="0dp"
                  android:layout_height="51dp"
                  android:layout_marginStart="8dp"
                  android:layout_marginTop="32dp"
                  android:layout_marginEnd="16dp"
                  android:layout_marginBottom="32dp"
                  android:background="@drawable/shape_rounded_rectangle"
                  android:fontFamily="@font/repsol_regular"
                  android:text="@string/join"
                  android:textAllCaps="false"
                  android:textColor="@color/colorPrimaryDark"
                  android:textSize="16sp"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toStartOf="@+id/btnNologin"
                  app:layout_constraintHorizontal_chainStyle="packed"
                  app:layout_constraintStart_toStartOf="@+id/marginStart"
                  app:layout_constraintTop_toBottomOf="@+id/btnLogin"
                  app:layout_constraintVertical_bias="0.75" /&gt;
  
  
              &lt;Button
                  android:id="@+id/btnNologin"
                  android:layout_width="0dp"
                  android:layout_height="51dp"
                  android:layout_marginStart="16dp"
                  android:layout_marginTop="16dp"
                  android:layout_marginEnd="8dp"
                  android:layout_marginBottom="32dp"
                  android:background="@drawable/shape_rounded_no_stroke_rectangle"
                  android:fontFamily="@font/repsol_regular"
                  android:text="@string/enter_without_login"
                  android:textAllCaps="false"
                  android:textColor="@color/colorPrimaryDark"
                  android:textSize="16sp"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toStartOf="@+id/marginEnd"
                  app:layout_constraintStart_toEndOf="@+id/btnJoin"
                  app:layout_constraintTop_toBottomOf="@+id/btnLogin"
                  app:layout_constraintVertical_bias="0.75" /&gt;
  
  
              &lt;androidx.constraintlayout.widget.Guideline
                  android:id="@+id/imageBottomMargin"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  app:layout_constraintGuide_percent="0.30" /&gt;
  
  
              &lt;androidx.constraintlayout.widget.Guideline
                  android:id="@+id/marginStart"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"
                  app:layout_constraintGuide_percent="0.10" /&gt;
  
              &lt;androidx.constraintlayout.widget.Guideline
                  android:id="@+id/marginEnd"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:orientation="vertical"
                  app:layout_constraintGuide_percent="0.90" /&gt;
  
  
              &lt;com.repsol.repsolmove.ui.widgets.RepsolDialog
                  android:id="@+id/dialog"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:elevation="10dp"
                  android:visibility="visible"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
  
              &lt;include
                  android:id="@+id/loading"
                  layout="@layout/loading"
                  android:visibility="gone"
                  app:layout_constraintBottom_toBottomOf="parent"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
      &lt;/androidx.core.widget.NestedScrollView&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  &lt;/layout&gt;
  </code></pre>