4

I am working on a phonegap application for IOS and I came across a problem.
Every time I open the keyboard and tap above it to close it it leaves a large white block on my screen.
enter image description here
As you can see in the gif above it is easily repairable by exiting the keyboard using the "done" button, but I like to have the same behavior when tapping on "zoek dossiers" for instance..

I think this is something that has to be solved in the xCode files instead of the html but here is my page anyway.

<!DOCTYPE html>
<html lang="nl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" />
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/assyst_app.js"></script>
<link rel="stylesheet" href="CSS/style.css" type="text/css" />
</head>
<header>
  <nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left transitions" id="cbp-spmenu-s1">
      <a id="su">Instellingen<span id="navIcon" class="icon-cog"></span></a>
      <a id="lo">Log uit<span id="navIcon" class="icon-logout"></span></a>
  </nav>
  <div class="navBar">
    <button class="navBut bgCol" id="showLeft" ><span class="icon-menu"></span></button>
    <div id="content"></div>
  </div>
</header>
<body onLoad="onLoadHolder()">
<div id="art">
<article id="relCont">          <!--            Phone               -->
    <form id="dossier-zoek">
        <input type="text" id="sea" name="search" class="regTXTBOX brdrCol" placeholder="Zoek">
        <button id="searchDos" class="bgCol">Zoek dossiers</button>
    </form>
    <h2 id="title" style="position:fixed; width:100%;" class="brdrCol txtCol">$!template.dossiers.list_title</h2>

    <div id="list" class="listDos">
        <table class="defTABLE">
            #foreach($row in $template.dossiers.data.records)
            <tr class="defTR">
                <td class="defTD">$!row.dossiernummer_c</td>
                <td class="defTD">$!row.inzake_c</td>
                <td class="defTD tableLink"><div class="icon-gt txtCol" id="$!row.dossier_id"></div></td>
            </tr>
            #end
        </table>
    </div>
</article>
</div>
<script>
            $(document).ready(onShowHolder());
</script>
</body>
</html>

Does anyone know how to solve this problem? I tried adding the meta tags for scaling but it didn't help.
I am using phonegap to build this app.

dennismuijs
  • 1,215
  • 1
  • 11
  • 24
  • I had a panic for a few seconds being convinced that my screen/SO is hacked with someone taking the mouse control over!!! 1+ – Neeku Jul 02 '14 at 14:42
  • Same issue here, but on focus out of `sea` , make `location.reload();` is the only solution I can give for this moment. – byJeevan Jul 02 '14 at 17:06
  • 1
    Thanks Jeek, it's not optimal but it's something. There has to be a way to do this properly.. @Neeku haha if I could script that I wouldn't be asking questions here – dennismuijs Jul 02 '14 at 19:12
  • possible duplicate of [PhoneGap Page scroll up after Keyboard appearance in iOS devices that makes the PhoneGap page corrupted](http://stackoverflow.com/questions/15000660/phonegap-page-scroll-up-after-keyboard-appearance-in-ios-devices-that-makes-the) – byJeevan Jul 03 '14 at 04:26
  • That question is not the same at all, not only have I already tried every solution mentioned there, my html page stays totaly intact except for the white block – dennismuijs Jul 03 '14 at 09:26

2 Answers2

0

It turns out this was a bug in IOS, since I updated my devices to IOS 8 it works way better.
The white block still shows up, but just for half a second and then it disappears again.

dennismuijs
  • 1,215
  • 1
  • 11
  • 24
  • Did you manage to make it without white block at all? Or the best version you found is to show for half a second? I have the same problem now in iOS 9 that I see a white block where is the keyboard when I close it for half a second. Thanks. – Daniel Dudas Apr 20 '16 at 08:14
  • 1
    The problem no longer occurs for me Daniel. I'm running ios 9.3.1 and cordova 6.1.1 The delay is also gone for me but I have no idea how I fixed it, sorry – dennismuijs Apr 21 '16 at 12:43
  • And what version of cordova-ios engine do you have? I have ~3.9.2 with cordova cli-5.2.0. I want to test with your version to see if this fix my problem. Thanks. – Daniel Dudas Apr 21 '16 at 14:17
  • my IOS version is 4.1.0 I hope this fixes it for you – dennismuijs Apr 22 '16 at 07:52
0

I also had this problem with iOS 9 and the solution that I found is to use WKWebView instead of UIWebView and the problem is gone.

You can find more details about how to install this here: https://github.com/Telerik-Verified-Plugins/WKWebView

Daniel Dudas
  • 2,972
  • 3
  • 27
  • 39
  • Are you sure wkwebview solved it? I'm still using the UIWebView and experience no issues – dennismuijs Apr 22 '16 at 07:53
  • For me I can't fixed the problem with `UIWebView` and when I change to `WKWebView` the problem fixed. I don't know why. Also I read that `WKWebView` has some speed improvements so I think it's not a bad idea to use it after all. – Daniel Dudas Apr 22 '16 at 08:33