1

I have a Cordova 2.1.0 project with the ChildBrowser plugin in it. Now when I close the ChildBrowser my keyboard and select menu are under the screen and are only showing the next / previous / done buttons. does anyone knows how to fix this issue? I saw someone saying to add

self.view.frame = [[UIScreen mainScreen] applicationFrame];

to viewWillAppear in the mainviewController however this didn't do it.

have seen https://github.com/phonegap/phonegap-plugins/issues/815 however no solution came up there.

Adriano Repetti
  • 65,416
  • 20
  • 137
  • 208
John In't Hout
  • 304
  • 1
  • 10

1 Answers1

0

Below code worked for me:

[theWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:
  @"document.querySelector('meta[name=viewport]').setAttribute('content', 'width=%d;', false); ", (int)theWebView.frame.size.width]];
[theWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:
  @"document.querySelector('meta[name=viewport]').setAttribute('content', 'height=%d;', false); ", (int)theWebView.frame.size.height]];

in webVieDidFinishLoad. Worked fine for me :)

Ref: https://stackoverflow.com/a/6104537/1000985

Community
  • 1
  • 1
wakeup
  • 495
  • 4
  • 19