You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2016/03/06 12:06:27 UTC
cordova-plugin-statusbar git commit: Fix for CB-10752 status bar
overlays the webview on iOS 6 in some cases
Repository: cordova-plugin-statusbar
Updated Branches:
refs/heads/master bf7869cec -> 7ca355222
Fix for CB-10752 status bar overlays the webview on iOS 6 in some cases
We don’t allow the statusbar to overlay the webview on iOS 6, but in
some cases it happens. This changes avoid it.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/7ca35522
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/7ca35522
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/7ca35522
Branch: refs/heads/master
Commit: 7ca35522242c1fa73b4e3e7b33b804c121e14194
Parents: bf7869c
Author: Julio César <jc...@gmail.com>
Authored: Sun Mar 6 11:55:49 2016 +0100
Committer: Julio César <jc...@gmail.com>
Committed: Sun Mar 6 11:55:49 2016 +0100
----------------------------------------------------------------------
src/ios/CDVStatusBar.m | 49 +++++++++++++++++++++------------------------
1 file changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/7ca35522/src/ios/CDVStatusBar.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index bab37a2..dcfb88f 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -411,11 +411,10 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
[self showStatusBar];
+ [self resizeWebView];
if (isIOS7) {
- [self resizeWebView];
-
if (!self.statusBarOverlaysWebView) {
// there is a possibility that when the statusbar was hidden, it was in a different orientation
@@ -430,39 +429,37 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
}
- } else {
-
- CGRect bounds = [[UIScreen mainScreen] applicationFrame];
- self.viewController.view.frame = bounds;
}
_statusBarBackgroundView.hidden = NO;
}
}
--(void)resizeWebView {
-
- CGRect bounds = [[UIScreen mainScreen] bounds];
-
- bounds = [self invertFrameIfNeeded:bounds];
-
- if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
- self.viewController.view.frame = bounds;
- }
-
- self.webView.frame = bounds;
-
- if (!self.statusBarOverlaysWebView) {
+-(void)resizeWebView
+{
+ BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
+
+ if (isIOS7) {
+ CGRect bounds = [[UIScreen mainScreen] bounds];
+ bounds = [self invertFrameIfNeeded:bounds];
- CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
- statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
+ if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
+ self.viewController.view.frame = bounds;
+ }
+ self.webView.frame = bounds;
- CGRect frame = self.webView.frame;
- frame.origin.y = statusBarFrame.size.height;
- frame.size.height -= statusBarFrame.size.height;
- self.webView.frame = frame;
+ if (!self.statusBarOverlaysWebView) {
+ CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
+ statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
+ CGRect frame = self.webView.frame;
+ frame.origin.y = statusBarFrame.size.height;
+ frame.size.height -= statusBarFrame.size.height;
+ self.webView.frame = frame;
+ }
+ } else {
+ CGRect bounds = [[UIScreen mainScreen] applicationFrame];
+ self.viewController.view.frame = bounds;
}
-
}
- (void) dealloc
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org