PhoneGap中的软键包含输入元素 [英] Softkeyboard in PhoneGap covers input elements

查看:120
本文介绍了PhoneGap中的软键包含输入元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过这个问题了几次,虽然没有答案似乎对我有用。

I've seen this question a few times, though none of the answers seems to work for me. I suspect I have done something incredibly stupid, and have missed the obvious (+1 for peer programming?)

使用PhoneGap开发Android版(SDK版本8+)PhoneGap(Cordova )2.0.0。我有一个用于用户设置输入的完整页面形式,其中等间隔的元素在页面下运行,在底部具有取消和提交按钮。当用户触摸上面的元素时,软键盘弹出,没有问题。但是,如果用户触摸了位于软键盘下面的元素(如果它显示),则在弹出时会被键盘覆盖。

Developing for Android (SDK Version 8+) with PhoneGap (Cordova) 2.0.0. I have a full page form for user settings input, with equally spaced elements running down the page, with cancel and submit buttons at the very bottom. When a user touches the upper elements, the softkeyboard pops up, and there is no issue. However, if the user touches an element which would be under the soft keyboard (if it were showing), then it is covered by the keyboard when it pops up.

I在清单文件中尝试了各种咒语和化身android:windowSoftInputMode =adjustPan(基于 http://solutions.michaelbrooks.ca/2011/07/05/android-soft-keyboard-resizes-web-view/ http://developer.android.com/guide/topics/manifest/activity-element.html #wsoft ),但没有效果,元素将被键盘隐藏。

I have attempted various incantations and incarnations of android:windowSoftInputMode="adjustPan" in the manifest file (based on http://solutions.michaelbrooks.ca/2011/07/05/android-soft-keyboard-resizes-web-view/ and http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft), but to no avail, elements will be hidden by the keyboard.

我的清单文件的相关部分看起来像这样

The relevent section of my manifest file looks like this

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".title"
        android:label="@string/title" android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
        android:windowSoftInputMode="adjustPan"
    </activity>
</application>

和index.html的视口部分(我看到一些关于更改的帖子) / p>

and the viewport section of the index.html (which i've seen some posts about changing)

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">

任何指针都将非常感谢。

any pointers would be greatly appreciated

欢呼

推荐答案

而不是

android:windowSoftInputMode="adjustPan" 

尝试

android:windowSoftInputMode="adjustResize"

这篇关于PhoneGap中的软键包含输入元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆