【发布时间】:2015-05-07 05:02:36
【问题描述】:
我遇到了键盘问题。当它消失时,它所占据的空间仍然是空白,其余的布局没有调整
普通屏幕:
带键盘:
键盘关闭:
我以前从未见过这个,所以我什至不知道从哪里开始寻找。这发生在 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>
这是我的清单文件
<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>
【问题讨论】:
-
也发布您的代码。
-
你在听软键盘的开/关操作吗?
-
同时发布您的清单文件。如果您使用
android:windowSoftInputMode="adjustResize",这是所有布局调整大小的效果,但存在半透明/透明的问题... -
@AnkitBansal 这只是一个基本的键盘,没有做任何花哨的打开/关闭操作
-
@eee 清单中没有关于 windowSoftInputMode 的内容。 “adjustResize”是默认的吗?
标签: android android-softkeyboard soft-keyboard