Preventing iOS Keyboard from scrolling page in cordova 3.5

后端 未结 2 2207
轻奢々
轻奢々 2021-02-20 01:21

I am using Cordova 3.5 and jQuery mobile to build an iOS app. I have disabled scrolling in most of the app; however, when I select an input field, the iOS keyboard opens and scr

2条回答
  •  时光取名叫无心
    2021-02-20 02:06

    From my experience, and saying this as a developer who avoids 3rd party plugins as much as possible, I've found that virtual keyboard issues in Cordova are best solved with a plugin.

    The Cordova plugin directory has several keyboard plugins (http://cordova.apache.org/plugins/?q=keyboard)

    I recommend the following plugin:
    https://github.com/cjpearson/cordova-plugin-keyboard

    Which provides the following command to disable scrolling when the virtual keyboard is open.

    cordova.plugins.Keyboard.disableScrollingInShrinkView(true);
    

提交回复
热议问题