У меня есть. xml активность
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_farm"
android:fillViewport="true"
android:scrollbars="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical">
<Button
android:id="@+id/buttonLogar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:layout_marginBottom="7dp"
android:background="@drawable/bgbuttonform"
android:drawableRight="@drawable/ic_check_black_24dp"
android:outlineAmbientShadowColor="@android:color/black"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="@string/confirmar_dados"
android:textColor="@android:color/white"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextPassword" />
<Button
android:id="@+id/btn_selecionar_foto"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="100dp"
android:background="@drawable/bg_btn_rounded_img"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:text="Selecione uma foto"
android:textColor="@android:color/white"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<EditText
android:id="@+id/editTextEmailUser"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="32dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="15dp"
android:background="@drawable/bg_editextrounded"
android:ems="10"
android:hint=" Digite aqui seu email"
android:inputType="textEmailAddress"
android:paddingLeft="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/editTextPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextUser" />
<EditText
android:id="@+id/editTextUser"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="32dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="15dp"
android:background="@drawable/bg_editextrounded"
android:ems="10"
android:hint="Digite aqui seu nome"
android:inputType="textPersonName"
android:paddingLeft="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/editTextEmailUser"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_selecionar_foto" />
<EditText
android:id="@+id/editTextPassword"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="32dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="8dp"
android:background="@drawable/bg_editextrounded"
android:ems="10"
android:hint="Digite aqui sua senha"
android:inputType="textPassword"
android:paddingLeft="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/buttonLogar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editTextEmailUser" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/imageFotoUser"
android:layout_width="150dp"
android:layout_height="150dp"
app:civ_border_color="@color/colorPrimary"
app:civ_border_width="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/btn_selecionar_foto"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/btn_selecionar_foto"
app:layout_constraintTop_toTopOf="@+id/btn_selecionar_foto"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/textViewInicial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="175dp"
android:layout_marginTop="48dp"
android:layout_marginEnd="178dp"
android:layout_marginBottom="33dp"
android:gravity="center"
android:text="Seja bem vindo(a) ao Agro Lucros!\nPreencha o formulário abaixo para seguir"
android:textColor="@android:color/black"
android:textSize="18.5dp"
android:textStyle="bold"
android:typeface="serif"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/btn_selecionar_foto"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textJaTemConta"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="40dp"
android:fontFamily="sans-serif-black"
android:text="Já possui uma conta? Clique aqui!"
android:textColor="@android:color/white"
android:textSize="20dp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ProgressBar
android:id="@+id/progressBar4"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/editTextEmailUser"
app:layout_constraintStart_toStartOf="@+id/editTextEmailUser"
app:layout_constraintTop_toTopOf="@+id/editTextEmailUser" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
Мне нужно, чтобы все элементы на экране можно было «прокручивать», потому что, когда моя виртуальная клавиатура появляется на экране, последние элементы исчезают с экрана. экран и не прокручиваться, когда на самом деле они должны «go вверх», для визуализации на последних элементах (последний текст редактирования и последняя кнопка).
В режиме «предварительного просмотра» ScrollView и Макет ограничения занимают весь экран правильно. См .: