mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-03-15 03:21:06 +08:00
Fix for CB-10752 status bar overlays the webview on iOS 6 in some cases
We don’t allow the statusbar to overlay the webview on iOS 6, but in some cases it happens. This changes avoid it.
This commit is contained in:
parent
bf7869cec7
commit
7ca3552224
@ -411,11 +411,10 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
||||
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
|
||||
|
||||
[self showStatusBar];
|
||||
[self resizeWebView];
|
||||
|
||||
if (isIOS7) {
|
||||
|
||||
[self resizeWebView];
|
||||
|
||||
if (!self.statusBarOverlaysWebView) {
|
||||
|
||||
// there is a possibility that when the statusbar was hidden, it was in a different orientation
|
||||
@ -430,39 +429,37 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
|
||||
self.viewController.view.frame = bounds;
|
||||
}
|
||||
|
||||
_statusBarBackgroundView.hidden = NO;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)resizeWebView {
|
||||
-(void)resizeWebView
|
||||
{
|
||||
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
|
||||
|
||||
CGRect bounds = [[UIScreen mainScreen] bounds];
|
||||
if (isIOS7) {
|
||||
CGRect bounds = [[UIScreen mainScreen] bounds];
|
||||
bounds = [self invertFrameIfNeeded:bounds];
|
||||
|
||||
bounds = [self invertFrameIfNeeded:bounds];
|
||||
if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
|
||||
self.viewController.view.frame = bounds;
|
||||
}
|
||||
self.webView.frame = bounds;
|
||||
|
||||
if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
|
||||
if (!self.statusBarOverlaysWebView) {
|
||||
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
|
||||
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
|
||||
CGRect frame = self.webView.frame;
|
||||
frame.origin.y = statusBarFrame.size.height;
|
||||
frame.size.height -= statusBarFrame.size.height;
|
||||
self.webView.frame = frame;
|
||||
}
|
||||
} else {
|
||||
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
|
||||
self.viewController.view.frame = bounds;
|
||||
}
|
||||
|
||||
self.webView.frame = bounds;
|
||||
|
||||
if (!self.statusBarOverlaysWebView) {
|
||||
|
||||
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
|
||||
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
|
||||
|
||||
CGRect frame = self.webView.frame;
|
||||
frame.origin.y = statusBarFrame.size.height;
|
||||
frame.size.height -= statusBarFrame.size.height;
|
||||
self.webView.frame = frame;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
Loading…
x
Reference in New Issue
Block a user