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

FIX: iOS 8 have problems with orintation #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ios/CDVStatusBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ - (void) _ready:(CDVInvokedUrlCommand*)command
- (void) initializeStatusBarBackgroundView
{
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0") ) {
// swap width and height. set origin to zero
statusBarFrame = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.size.width);
}
Expand All @@ -150,7 +150,7 @@ - (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView
if (statusBarOverlaysWebView) {

[_statusBarBackgroundView removeFromSuperview];
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0")) {
self.webView.frame = CGRectMake(0, 0, bounds.size.height, bounds.size.width);
} else {
self.webView.frame = bounds;
Expand All @@ -164,7 +164,7 @@ - (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView

CGRect frame = self.webView.frame;

if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0")) {
frame.origin.y = statusBarFrame.size.width;
frame.size.height -= statusBarFrame.size.width;
} else {
Expand Down Expand Up @@ -324,7 +324,7 @@ - (void) hide:(CDVInvokedUrlCommand*)command
CGRect frame = self.webView.frame;
frame.origin.y = 0;

if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0")) {
frame.size.height += statusBarFrame.size.width;
} else {
frame.size.height += statusBarFrame.size.height;
Expand Down Expand Up @@ -374,7 +374,7 @@ - (void) show:(CDVInvokedUrlCommand*)command
// statusBar's current size
CGRect sbBgFrame = _statusBarBackgroundView.frame;

if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation)) {
if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0")) {
frame.origin.y = statusBarFrame.size.width;
frame.size.height -= statusBarFrame.size.width;
sbBgFrame.size = CGSizeMake(statusBarFrame.size.height, statusBarFrame.size.width);
Expand Down