键盘显示时如何向上移动整个布局?

Sin*_*ami 20 android android-softkeyboard

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_gravity="bottom"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content" /> 
        </LinearLayout>    

</FrameLayout>  
Run Code Online (Sandbox Code Playgroud)

在清单中:

 android:windowSoftInputMode="adjustPan"
Run Code Online (Sandbox Code Playgroud)

初始行为:

在此输入图像描述

目前的行为:

在此输入图像描述

期望的行为:

在此输入图像描述

如何实现所需的布局行为?adjustResize不适合,因为此选项调整布局大小.

谢谢你的回答!

小智 1

检查包含EditText和Button的布局是否为RelativeLayout。