Android 停止键盘按对齐到底部视图

Android 停止键盘按对齐到底部视图,android,view,android-softkeyboard,android-constraintlayout,Android,View,Android Softkeyboard,Android Constraintlayout,我有一个具有以下层次结构的ConstraintLayout: <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <EditText app:layout_constraintStart_toStartOf="parent" app

我有一个具有以下层次结构的
ConstraintLayout

<android.support.constraint.ConstraintLayout
   android:layout_width="match_parent"
   android:layout_height="match_parent">

   <EditText
           app:layout_constraintStart_toStartOf="parent"
           app:layout_constraintEnd_toEndOf="parent"
           app:layout_constraintTop_toBottomOf="parent"/>

   <RecyclerView
           android:layout_width="0dp"
           android:layout_height="0dp"
           app:layout_constraintStart_toStartOf="parent"
           app:layout_constraintEnd_toEndOf="parent"
           app:layout_constraintBottom_toTopOf="Button"
           app:layout_constraintTop_toBottomOf="EditText"/>

   <Button
           app:layout_constraintBottom_toBottomOf="parent"
           app:layout_constraintEnd_toEndOf="parent"
           app:layout_constraintStart_toStartOf="parent"/>

</ConstraintLayout>
我如何才能做到这一点?
谢谢你抽出时间

ps:我能想到的唯一解决办法是在键盘出现时隐藏
按钮。

这样做

<activity
   ...
   android:windowSoftInputMode="adjustPan"> 
</activity>

尝试使用用户
无需调整
而不是
调整span

<activity
     ...
     android:windowSoftInputMode="adjustNothing"> 
</activity>


使用adjustPan,这样屏幕就不会调整大小,整个屏幕就可以上移。或者使用none,这样键盘就会出现在视图的顶部,但在这种情况下,您可能无法看到用户正在键入的内容,因为它可能会被覆盖。当键盘打开时隐藏按钮是不可能的,因为没有可靠的方法来检测。有一些破解,但这些破解并不总是正确的。使用adjustPan或adjustNothing不起作用,按钮被按下。如果adjust nothing起作用,则说明您在错误的位置使用了它。“平移”会将按钮向上移动,但会将整个屏幕向上移动-相对位置将保持不变。@GuilhE嗨,我遇到了完全相同的问题。你有没有想出一个解决方案,让键盘在不移动其他任何东西的情况下弹出?
<activity
     ...
     android:windowSoftInputMode="adjustNothing"> 
</activity>