Android-键盘消失时仍留有空格

The*_*man 5 android soft-keyboard android-softkeyboard

我的键盘有问题。当它消失时,它所占据的空间将保持空白,并且布局的其余部分不会调整

正常屏幕:

在此处输入图片说明

带键盘:

在此处输入图片说明

键盘已关闭:

在此处输入图片说明

我之前从未见过,所以我什至不知道从哪里开始寻找。这发生在4.2.2和5.1

另一个重要的信息是这是一个自定义的LinearLayout,其中包含所有内容。也许与此有关。如有必要,我可以上传任何代码。

这是主布局文件外壳。

<com.edgetechlabs.app_v2.MasterLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Menu (Drawer)-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:visibility="visible"
    android:layout_height="match_parent"
    android:orientation="vertical" >
     <ScrollView
        android:id="@+id/activity_main_menu_listview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/drawer_background"
        android:cacheColorHint="#00000000" >
     </ScrollView>
</LinearLayout>
<!-- Fragment Holder -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <!-- This is where fragment will show up -->
    <FrameLayout
        android:id="@+id/fragment_master"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </FrameLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

这是我的清单文件

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MasterActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

The*_*man 6

我加了

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

到我在活动标签内的清单中,现在可以使用了。我以前从来没有做过此事,我想我的自定义布局会以某种方式弄乱键盘。

感谢@eee的评论为我指出了正确的方向