Phonegap KeyboardShrinks iOS上固定的视图和位置不正确应用 [英] Phonegap KeyboardShrinksView and position fixed on iOS not applying correctly

查看:148
本文介绍了Phonegap KeyboardShrinks iOS上固定的视图和位置不正确应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的PhoneGap的2.9.0版本,我希望当键盘出现我的WebView缩小像它在Android phonegap应用程序。我有页脚和标题元素在固定位置,当键盘打开时,会导致麻烦(页脚和标题松开其固定位置状态)。

I use the 2.9.0 version of Phonegap and I want that when the keyboard appears my WebView shrinks like it's done in Android phonegap apps. I have footer and header elements in fixed position, and when the keyboard is open it causes trouble (the footer and header loose their fixed position state).

我认为KeyboardShrinksView设置可以修复,根据phonegap文档: http://docs.phonegap.com/en/2.9.0rc1/guide_project-settings_ios_index.md.html#Project%20Settings%20for%20iOS

I think the KeyboardShrinksView settings could fix that, according to the phonegap documentation : http://docs.phonegap.com/en/2.9.0rc1/guide_project-settings_ios_index.md.html#Project%20Settings%20for%20iOS

但是很多尝试我不能使它工作,WebView不收缩。

But with a lot of try I'm not able to make it work, the WebView doesn't shrinks.

我想是可能来自我的config.xml中设置的其他偏好之间的冲突:

I was thinking maybe it can come from a conflict between others preferences set on my config.xml :

config.xml

<gap:platform name="ios" />
<gap:platform name="android" />

<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="false" />
<preference name="orientation" value="portrait" />
<preference name="KeyboardShrinksView" value="true" />

或者也许它可以来自元标记定义,特别是视口:

Or maybe it can come from meta tag definition, specially the viewport :

index.html

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" /> 

你知道为什么它不工作吗?

Do you know why it's not working ? Or do you have a workaround for this ?

编辑:我看到当KeyboardShrinksView = true时,它会改变一些东西,但是当键盘打开时,它会隐藏底部我的内容(包括我的页脚和字段),而不是调整我的整个内容。

EDIT : I had seen that it changes something when KeyboardShrinksView=true, but when the keyboard is open, it's hidding the bottom of my content (including my footer and the field) instead of resizing my whole content. I expect it's placing my footer just at the top of the keyboard, am I right ?

感谢您的帮助

推荐答案

是的 - 这是一个痛苦,现在处理。目前没有真正的解决方案,使事情像他们以前在iOS。就我个人而言,我目前在我的应用程序中使用两个不同的标签(一个用于iOS,一个用于Android),它接近iOS上的旧行为。这里是我使用:

Yeah - this is a pain to deal with right now. Currently there is no real fix to make things like they used to be in iOS. Personally, I currently juggle two different tags in my apps (one for iOS and one for Android) and it gets close to the old behavior on iOS. Here's what I use:

        <!-- IOS --> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" />`
        <!-- ANDROID --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" />

我的config.xml设置是你期望的:

My config.xml settings are what you'd expect:

        <preference name="HideKeyboardFormAccessoryBar" value="true" />
        <preference name="KeyboardShrinksView" value="false" />

这里有几个链接,关注 (即请求)Cordova人最终解决它。

Here are a few links to keep an eye on and to keep bugging (i.e. requesting) that the Cordova folks finally fix it.

  • Issue CB-4862: https://issues.apache.org/jira/browse/CB-4862 (This is the core issue thread. It was originally closed but after a comment I made a while ago it was reopened)

问题CB-5852: https://issues.apache.org/jira/browse/CB-5852 (这是CB-4862的人被告知可能的修复可能存在 - 但是devs的初始测试显示

Issue CB-5852: https://issues.apache.org/jira/browse/CB-5852 (This is where CB-4862 folks were told a possible fix might exist - but initial tests by devs show it's not really a solution sadly).

希望这些链接至少可以帮助您更新最新信息对keyboardshrink相关问题。如果其他任何人有这方面的潜在客户/链接,请分享!

Hopefully these links will at least help get you up to date w/the latest info on the keyboardshrink related issues. If anyone else has leads/links on this please do share!

这篇关于Phonegap KeyboardShrinks iOS上固定的视图和位置不正确应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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