PhoneGap 3.3 iOS KeyboardShrinksView

余生长醉 提交于 2019-12-30 04:48:06

问题


In PhoneGap/Cordova 3.3 (and 3.2) the preference KeyboardShrinksView for iOS is gone and has been replaced with enableViewPortScale.

Can anyone explain to me how to achieve the same result I would get with KeyboardShrinksView but by using enableViewPortScale and the viewport Metatag?

When in iOS, if the user opens the keyboard I need the entire view to shrink.


回答1:


Here is what I ended up doing:

<meta name="viewport" content="initial-scale=1, minimum-scale=1, 
maximum-scale=1, user-scalable=0, height=device-height"/>

Thanks to @daniel-miller, the answer above came from him here:

Keyboard hides iOS input fields in PhoneGap Build 3.1 with an iFrame/object and JQTouch

Other Help: https://groups.google.com/forum/#!topic/phonegap/87K3lYr6f40




回答2:


The commit that removes these (see https://issues.apache.org/jira/browse/CB-4978) states:

The Keyboard preferences have been removed from core and put into its own plugin in cordova-labs plugins branch.

I've tracked this down to https://github.com/apache/cordova-plugins/tree/master/keyboard and this fork (?): https://github.com/etiennea/phonegap-keyboard

This should then allow you to use

Keyboard.shrinkView(true)

in your JS to minic the old functionality of KeyboardShrinksView



来源:https://stackoverflow.com/questions/21739396/phonegap-3-3-ios-keyboardshrinksview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!