Cordova / Phonegap 3.1键盘(静止)叠加焦点形式字段 - iOS 7 [英] Cordova/Phonegap 3.1 keyboard (still) overlays focused form fields - iOS 7

查看:153
本文介绍了Cordova / Phonegap 3.1键盘(静止)叠加焦点形式字段 - iOS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从cordova 3.0升级到3.1,我仍然遇到一个非常令人不安的问题(仍然存在,当使用KeyboardShrinksView偏好播放时)。

Hi guys I just upgraded from cordova 3.0 to 3.1 and I'm still experiencing a very disturbing issue (which still exists when playing with KeyboardShrinksView preference).

我集中一个元素(input / textarea)触发键盘打开,元素被隐藏在键盘后面,我需要向下滚动(使用webkit溢出滚动滚动顺序)为了看到元素和其内容。

Whenever I'm focusing an element (input/textarea) which triggers the keyboard opening, the element gets hidden behind the keyboard and I need to scroll down (using webkit-overflow-scrolling for scrolling by the way) in order to see the element and its content.

当KeyboardShrinksView设置为true时,页面甚至不会滚动,甚至更糟。

When KeyboardShrinksView is set to true the page won't even scroll, making it even worse.

解决方案,以解决这个问题?我已经看过几个问题和错误报告,但没有工作解决方案(或解决方案)。

Any solutions in order to fix this issue? I've seen a few questions and bug reports but with no working solutions (or solutions at all).

使用全屏偏好设置无法解决问题。

Playing with the "fullscreen" preference won't solve the problem.

感谢您的帮助

推荐答案

以下插件的帮助: jQuery scrollTo插件

每当我关注某个元素时,我将触发一个焦点事件,并执行以下计算并更新滚动位置:

Whenever i'm focusing on an element i'm triggering a focus event which does the following calculations and updates the scroll position:

updateScroll: function(e){
    var el = $(e.currentTarget);
    var offset = -$(".scrollerWrap").height() + $(el).height();
    $(".scrollerWrap").scrollTo(el,{offset: offset});
}

将输入/文本区域的底部粘贴到键盘顶部。就像一个魅力,即使解决方案需要经过这一点的JavaScript。

Sticks the bottom of the input/textarea to the top of the keyboard. Works like a charm, even if the solution needs to go through that bit of JavaScript.

这篇关于Cordova / Phonegap 3.1键盘(静止)叠加焦点形式字段 - iOS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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