cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jcesarmobile (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-9724) StatusBar in iOS: Size of the status bar is calculated incorrectly after a orientation change
Date Thu, 01 Oct 2015 21:03:26 GMT

    [ https://issues.apache.org/jira/browse/CB-9724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14940410#comment-14940410
] 

jcesarmobile commented on CB-9724:
----------------------------------

I can't reproduce your issue, but I'm not really sure if I understand your problem and your
changes.

According to you, the size of the status bar is incorrect, but the code you say that fixes
your problem changes the size of the webview, not the status bar size

And the code you changed doesn't match with the latest version on gibhub, please, install
the latest version from github and check again

cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git

Do you have some preference like <preference name="StatusBarOverlaysWebView" value="true"
/>?

> 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


Mime
View raw message