From 16ff9b449f83a71b6bf80ca59b44bed84f2af810 Mon Sep 17 00:00:00 2001 From: daserge Date: Tue, 5 Apr 2016 17:39:36 +0300 Subject: [PATCH] CB-11018 Fix statusbar with inappbrowser causing incorrect orientation on iOS8 --- src/ios/CDVStatusBar.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m index 23c983a..a26a15f 100644 --- a/src/ios/CDVStatusBar.m +++ b/src/ios/CDVStatusBar.m @@ -446,7 +446,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle; if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) { self.viewController.view.frame = bounds; } else if (self.viewController.presentedViewController != nil) { - bounds = CGRectMake(0, 0, bounds.size.height, bounds.size.width); + // https://issues.apache.org/jira/browse/CB-11018 + BOOL isIOS8 = (IsAtLeastiOSVersion(@"8.0")); + BOOL isIOS9 = (IsAtLeastiOSVersion(@"9.0")); + if (isIOS8 && !isIOS9) { + // iOS 8 + bounds = CGRectMake(0, 0, bounds.size.width, bounds.size.height); + } else { + // iOS7, iOS9+ + bounds = CGRectMake(0, 0, bounds.size.height, bounds.size.width); + } } self.webView.frame = bounds;