0 Favourites

[Solved] Avoid scrolling if keyboard appears on ios app

  • Hello there!

    I need help with another scrolling issue: If iam opening the webview window where i can insert some informations (writing an email or something) - the ios keyboard appears, and the whole application is scrolled up. The weird thing is: i get a black bar (from the bottom of the app to the virtual keyboard)

    iam using this line of code to avoid basically scrolling in the app (included into the intelxdk.additions file)

    <preference name="DisallowOverscroll" value="true" />

    Is there a solution to avoid the scrolling, if youre using a virtual keyboard?

    thank you very much!

    Screenshot:

    http://imgur.com/a/YqOxn

  • do a search on cordova issue or on ios safari iframe problems

    google is your friend

  • I found a cordova solution (ionic keyboard plugin you can add in the xdk manager)

    but iam not sure where i would have to embed the code...

    excample:

    http://ionicframework.com/docs/v1/api/page/keyboard/

    Do you know how to handle this?

  • i did never use ionic

    i'm using standard cordova CLI

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • All

    I solved this issue - i did (of course a lot of research) and found a solution.

    At first add the ionic keyboard plugin into cordova. Then you have to prepare your index.html file too.

    Add:

    cordova.plugins.Keyboard.disableScroll(true);

    into the deviceready function.

    in my case it looks like this:

    <script>

    document.addEventListener("deviceready", function ()

    {

    cordova.plugins.Keyboard.disableScroll(true);

    window["c2iscordova"] = true;

    // Create new runtime using the c2canvas

    cr_createRuntime("c2canvas");

    document.addEventListener("pause", function() {

    cr_setSuspended(true);

    }, false);

    document.addEventListener("resume", function() {

    cr_setSuspended(false);

    }, false);

    }, false);

    </script>

    In the intelxdk.confing.additions i added some preferences on top of the script. It looks like this:

    <!-- Change the debuggable preference to true to build a remote CDT debuggable app for -->

    <!-- Crosswalk apps on Android 4.0+ devices and Cordova apps on Android 4.4+ devices. -->

    <preference name="debuggable" value="false" />

    <preference name="DisallowOverscroll" value="true" />

    <preference name="KeyboardDisplayRequiresUserAction" value="false"/>

    Thats it. It works in my case.

    Have a nice day!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)