我的键盘有问题。当它消失时,它所占据的空间仍然是空白,其余布局不会调整
正常屏幕:
带键盘:
键盘已关闭:
我以前从未见过这个,所以我什至不知道从哪里开始寻找。 4.2.2 和 5.1 上都会发生这种情况
另一条重要信息是,这是一个包含所有内容的自定义 LinearLayout。也许与此有关。如果需要,我可以上传任何代码。
这是主要的布局文件 shell。
<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>
这是我的清单文件
<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>
I added
android:windowSoftInputMode="adjustPan"
到我的活动标签内的清单,现在它可以工作了。我以前从未这样做过,我猜我的自定义布局不知何故弄乱了键盘。
感谢@eee 评论为我指明了正确的方向
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)