android - Honeycomb (3.1) adjustResize 不再有效?

标签 android layout resize android-3.0-honeycomb android-softkeyboard

我的 Activity 有 android:windowSoftInputMode="adjustResize"并且在 Android 2.1 中有相应的行为:

软键盘出现前

Before soft keyboard appears

用键盘

Keyboard behavior in 2.1 (good)

但是,在 Honeycomb 中,软键盘不会调整我的布局,而是覆盖按钮:

Keyboard behavior in Honeycomb (bad)

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/

相关文章:

android - 将类类型作为参数传递并针对 Kotlin 中的另一个对象检查类型

ios - 我在界面生成器中创建了一个 UIImage View ,如何在代码中更改其框架(位置和大小)?

css - 如何将固定的页脚背景图像调整为我想要的分辨率?

algorithm - 什么是最好的图像缩小算法(质量方面)?

android - 使用协程的 Firebase 实时快照监听器

java - 在 android studio 中使用 LatLng 的问题

android - 搜索栏未到达末尾

css - Div不会居中

css - 在底部显示页脚

c# - 用户控件调整大小