cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-plugin-statusbar git commit: CB-8720 Fix status bar position when app started upside down on iOS 7. This closes #44
Date Tue, 05 Jan 2016 10:35:15 GMT
Repository: cordova-plugin-statusbar
Updated Branches:
  refs/heads/master 3e9ce84a5 -> d853f828d


CB-8720 Fix status bar position when app started upside down on iOS 7. This closes #44


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/d853f828
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/d853f828
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/d853f828

Branch: refs/heads/master
Commit: d853f828d614778e66ec4e6b3b0b79cbb9601d5f
Parents: 3e9ce84
Author: Vladimir Kotikov <kotikov.vladimir@gmail.com>
Authored: Wed Dec 30 10:16:58 2015 +0300
Committer: Vladimir Kotikov <kotikov.vladimir@gmail.com>
Committed: Tue Jan 5 13:34:37 2016 +0300

----------------------------------------------------------------------
 src/ios/CDVStatusBar.m | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/d853f828/src/ios/CDVStatusBar.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index e7bf869..7e071b2 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -180,6 +180,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
 - (void) initializeStatusBarBackgroundView
 {
     CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
+
+    if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown
&&
+        statusBarFrame.size.height + statusBarFrame.origin.y == [[UIScreen mainScreen] bounds].size.height)
{
+
+        // When started in upside-down orientation on iOS 7, status bar will be bound to
lower edge of the
+        // screen (statusBarFrame.origin.y will be somewhere around screen height). In this
case we need to
+        // correct frame's coordinates
+        statusBarFrame.origin.y = 0;
+    }
+
     statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation];
 
     _statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message