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 <[email protected]> Authored: Wed Dec 30 10:16:58 2015 +0300 Committer: Vladimir Kotikov <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
