我的 Activity 有 android:windowSoftInputMode="adjustResize"并且在 Android 2.1 中有相应的行为:
软键盘出现前
用键盘
但是,在 Honeycomb 中,软键盘不会调整我的布局,而是覆盖按钮:
10 英寸 Galaxy 标签和 Motorola Xoom 上的行为相同。
我多次修改我的布局,试图使其与 Honeycomb 兼容,但无济于事。软键盘将向上推 EditText View ,但不会向上推按钮。
Here is a simple app project demonstrating the problem.
编辑:链接已修复。
使用的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save" />
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel" />
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true">
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</ScrollView>
</RelativeLayout>
我发现的唯一相关问题是 this ,但禁用硬件加速对我没有影响。我也阅读了 Android guide on making your app compatible with input methods ,但在那里没有发现任何解决方案。
我做错了什么吗?或者这是一个任何人都有更多信息的错误?
最佳答案
您好,我已经检查了您的代码。
请删除“AndroidManifest.xml”中的以下行
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
然后检查然后调整屏幕大小。
如果有任何疑问请告诉我。
关于android - Honeycomb (3.1) adjustResize 不再有效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6599341/