You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ronny Schleicher (JIRA)" <ji...@apache.org> on 2015/10/02 09:31:26 UTC
[jira] [Updated] (CB-9724) StatusBar in iOS: Size of the status bar
is calculated incorrectly after a orientation change
[ https://issues.apache.org/jira/browse/CB-9724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ronny Schleicher updated CB-9724:
---------------------------------
Environment: iPhone or iPad with iOS version 8 and 9. (was: iPhone with iOS version 8 and 9.)
> 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 or iPad 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