Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 254CB18EB1 for ; Thu, 1 Oct 2015 10:46:27 +0000 (UTC) Received: (qmail 14875 invoked by uid 500); 1 Oct 2015 10:46:26 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 14827 invoked by uid 500); 1 Oct 2015 10:46:26 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 14585 invoked by uid 99); 1 Oct 2015 10:46:26 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2015 10:46:26 +0000 Date: Thu, 1 Oct 2015 10:46:26 +0000 (UTC) From: "jcesarmobile (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CB-9724) StatusBar in iOS: Size of the status bar is calculated incorrectly after a orientation change MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] jcesarmobile reassigned CB-9724: -------------------------------- Assignee: jcesarmobile > StatusBar in iOS: Size of the status bar is calculated incorrectly after a orientation change > --------------------------------------------------------------------------------------------- > > Key: CB-9724 > URL: https://issues.apache.org/jira/browse/CB-9724 > Project: Apache Cordova > Issue Type: Bug > Components: CordovaLib > Affects Versions: 3.5.0, 4.1.0 > Environment: iPhone with iOS version 8 and 9. > Reporter: Ronny Schleicher > Assignee: jcesarmobile > > h3. Steps to reproduce: > 1. Create a PhoneGap App and use the Statusbar-Plugin to show the Statusbar. > 2. Start your App in Portrait. > 4. Now remove the statusbar in the runtime of your app (with a button click or somethink else) with 'StatusBar.hide();' > 5. Now turn the iPhone 90 degrees in landscape mode. > 6. After this enable the StatusBar in the runtime of your app (with a button click or somethink else) with 'StatusBar.show();' > 7. Error -> the StatusBar size in incorrect. > h3. My Workaround / Bugfix > Add in the file '.\Plugins\cordova-plugin-statusbar\CDVStatusBar.m' in follow two function a && !IsAtLeastiOSVersion(@"8.0"). In my m-file is it in line 204 and 373. > {code:title=CDVStatusBar.m|borderStyle=solid} > - (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView > { > // we only care about the latest iOS version or a change in setting > if (!IsAtLeastiOSVersion(@"7.0") || statusBarOverlaysWebView == _statusBarOverlaysWebView) { > return; > } > CGRect bounds = [[UIScreen mainScreen] bounds]; > if (statusBarOverlaysWebView) { > [_statusBarBackgroundView removeFromSuperview]; > 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; > } > } else { > CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; > statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation]; > [self initializeStatusBarBackgroundView]; > CGRect frame = self.webView.frame; > frame.origin.y = statusBarFrame.size.height; > frame.size.height -= statusBarFrame.size.height; > self.webView.frame = frame; > [self.webView.superview addSubview:_statusBarBackgroundView]; > } > _statusBarOverlaysWebView = statusBarOverlaysWebView; > } > - (void) hide:(CDVInvokedUrlCommand*)command > { > UIApplication* app = [UIApplication sharedApplication]; > if (!app.isStatusBarHidden) > { > self.viewController.wantsFullScreenLayout = YES; > CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; > [self hideStatusBar]; > if (IsAtLeastiOSVersion(@"7.0")) { > [_statusBarBackgroundView removeFromSuperview]; > } > if (!_statusBarOverlaysWebView) { > CGRect frame = self.webView.frame; > frame.origin.y = 0; > if (!self.statusBarOverlaysWebView) { > if (UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation) && !IsAtLeastiOSVersion(@"8.0")) { > frame.size.height += statusBarFrame.size.width; > } else { > frame.size.height += statusBarFrame.size.height; > } > } > self.webView.frame = frame; > } > _statusBarBackgroundView.hidden = YES; > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org