Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 7 and status bar #13

Open
alextrs opened this issue Mar 30, 2014 · 2 comments
Open

iOS 7 and status bar #13

alextrs opened this issue Mar 30, 2014 · 2 comments

Comments

@alextrs
Copy link

alextrs commented Mar 30, 2014

Looks like there is an issue with the way this plugin moves and resizes webView. In iOS 7 status bar covers the top of main view. You can change this behaviour using this plugin 'com.phonegap.plugin.statusbar' (move webView down 20px), but this plugin after initialization moves webView back to top.
f1a7945e-b853-11e3-8159-2158bead550a
Looks like by changing the following code:

  // Move the webview to the top of the screen.
    webViewFrame.origin.y = 0; 
 ...
webViewFrame.size.height = superViewFrame.size.height - bannerViewFrame.size.height;

To:

  // Move the webview to the top of the screen.
    if ([[UIDevice currentDevice].systemVersion floatValue] >= 7)
      webViewFrame.origin.y = 20;
    else
      webViewFrame.origin.y = 0;
   ...
      webViewFrame.size.height = superViewFrame.size.height - webViewFrame.origin.y - bannerViewFrame.size.height;

Resolves the issue, but I'm not sure what else it can break.

@dawez
Copy link

dawez commented Aug 20, 2014

HI tried the above patch in 2 separate plugins : org.apache.cordova.statusbar and com.phonegap.plugin.statusbar. Both times that I implemented that the behavior of the webview is not changing. When the Ad is shown the webview get and incorrect margin [like the toolbar would be ignored].

I am using in the js cordova code : StatusBar.overlaysWebView(false); to prevent a bug appearing in IOS7.

@dezudas
Copy link

dezudas commented Dec 28, 2014

I ma having the same issue, and not resolved using provided solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants