我正在使用android:windowSoftInputMode="adjustResize"
,但是我需要固定特殊的视图,因此该视图不会影响调整大小。我为https://youtu.be/Ot5OFo4YlBU拍摄了一段简短的视频,我不想在打开键盘时看到条款和条件文本。
我尝试了scrollview,但是没有用。
Android: Resize only parts of view with soft keyboard on screen
我也使用了android:fitsSystemWindows
,但是没有用。
这是我的整个布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SignInActivity">
<android.support.constraint.ConstraintLayout
android:id="@+id/registering_layout"
android:layout_width="match_parent"
android:layout_height="0dp" app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
app:layout_constraintBottom_toTopOf="@+id/login"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#747474"
android:letterSpacing="-0.01"
android:lineSpacingExtra="8sp"
tools:text="@string/we_just_send_an_email"
android:layout_marginTop="24dp" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="16dp"
android:layout_marginStart="16dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="16dp" android:layout_marginRight="16dp" android:id="@+id/txt_email_sent"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:textColor="@color/dark_sky_blue"
android:text="@string/didnt_receive_link"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@+id/txt_email_sent" android:layout_marginTop="24dp"
android:layout_marginStart="16dp" app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="16dp" android:id="@+id/textView4"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:textColor="@color/dark_sky_blue"
android:text="@string/change_my_mail"
android:layout_marginTop="24dp"
app:layout_constraintTop_toBottomOf="@+id/textView4" android:layout_marginStart="16dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="16dp"
android:textStyle="bold"/>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/welcome_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="120dp"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
android:visibility="visible"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/txt_terms"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="16sp"
android:letterSpacing="-0.01"
android:lineSpacingExtra="8sp"
android:fitsSystemWindows="false"
android:text="@string/agree_privacy_policy"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="16dp" android:layout_marginRight="16dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
app:layout_constraintHorizontal_bias="0.0" android:layout_marginBottom="72dp"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#747474"
android:letterSpacing="-0.01"
android:lineSpacingExtra="8sp"
android:text="@string/you_will_use_this_email"
android:layout_marginTop="32dp"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:id="@+id/textView2" app:layout_constraintTop_toTopOf="parent"/>
<EditText
android:id="@+id/email"
android:hint="@string/your_email_address"
android:textSize="16sp"
android:textColor="#afafaf"
android:lineSpacingExtra="10sp"
android:drawablePadding="15dp"
android:drawableLeft="@drawable/envelope_blue"
android:backgroundTint="@color/colorPrimaryDark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintTop_toBottomOf="@+id/textView2"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp" android:text="stack@overflow.com"/>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
android:layout_height="120dp"
android:background="@color/dark_sky_blue"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" android:id="@+id/constraintLayout">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content" app:srcCompat="@drawable/logo_small"
android:id="@+id/imageView2" android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginLeft="16dp" android:layout_marginStart="16dp"/>
<TextView
android:id="@+id/welcome_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:textColor="#ffffff"
android:letterSpacing="-0.02"
android:text="Hello stackoverflow"
android:layout_marginBottom="16dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content" app:srcCompat="@drawable/ic_support_white"
android:id="@+id/imageView5" app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="16dp"
android:layout_marginRight="16dp" android:layout_marginTop="16dp"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
<Button
android:visibility="visible"
android:layout_width="0dp"
android:layout_height="56dp"
android:id="@+id/login"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/topaz"
android:textSize="17sp"
android:textColor="#ffffff"
android:gravity="center"
android:text="@string/CONTINUE"/>
<ProgressBar
android:visibility="gone"
style="?android:attr/progressBarStyle"
android:layout_width="26dp"
android:layout_height="26dp"
android:id="@+id/progressBar"
android:elevation="2dp"
app:layout_constraintTop_toTopOf="@+id/login"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.454"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginEnd="8dp"
android:indeterminate="true"
android:indeterminateTintMode="src_atop"
android:indeterminateTint="@color/white"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginRight="8dp" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginLeft="8dp"/>
我希望固定条款和条件文本,并且在打开键盘时它不会改变位置,并且会停留在键盘下。只需继续按钮即可移动。