Handle extended status bar on iOS

This closes #55
This commit is contained in:
Gosha Arinich 2016-04-07 16:44:32 +03:00 committed by Julio César
parent f2c49454da
commit 554e65e60f

View File

@ -442,7 +442,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
if (isIOS7) {
CGRect bounds = [[UIScreen mainScreen] bounds];
bounds = [self invertFrameIfNeeded:bounds];
if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
self.viewController.view.frame = bounds;
} else if (self.viewController.presentedViewController != nil) {
@ -462,7 +462,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
}
}
self.webView.frame = bounds;
if (!self.statusBarOverlaysWebView) {
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
@ -470,6 +470,15 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
frame.origin.y = statusBarFrame.size.height;
frame.size.height -= statusBarFrame.size.height;
self.webView.frame = frame;
} else {
// even if overlay is used, we want to handle in-call/recording/hotspot larger status bar
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
CGRect frame = self.webView.frame;
CGFloat height = statusBarFrame.size.height;
frame.origin.y = height >= 20 ? height - 20 : 0;
frame.size.height -= frame.origin.y;
self.webView.frame = frame;
}
} else {
CGRect bounds = [[UIScreen mainScreen] applicationFrame];