Preventing iOS Keyboard from scrolling page in cordova 3.5

后端 未结 2 2213
轻奢々
轻奢々 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:03

    Add this plugin with

    cordova plugin add https://github.com/driftyco/ionic-plugins-keyboard.git
    

    in the command line.

    Add the following line anywhere it the javascript to disable scrolling from the keyboard.

    cordova.plugins.Keyboard.disableScroll(true);
    

    In my use case, I added a deviceready event listener to evaluate this line, disabling the automatic keyboard scrolling everywhere in the app.

    That's it!

提交回复
热议问题