У меня проблема с нижним макетом, где мой макет ограничений не полностью заполняет представление прокрутки (пустое пространство ниже). Это изображение свидетельствует о проблеме.
В этом случае я хочу, чтобы серый фон заполнил этот пробел ниже. Я пытался сопоставить родителя во всем, но он не работает.
Это мой XML-файл, который принадлежит загруженному макету
<?xml version="1.0" encoding="utf-8"?>
<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">
<data>
<variable
name="viewModel"
type="com.repsol.repsolmove.ui.login.LoginViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:id="@+id/scrolView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
<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" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>