From d735649fcd9e8ebd9e3fc84e48b9315380dc2b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Wed, 21 Dec 2016 00:39:25 +0100 Subject: [PATCH] CB-10799 (ios) fix toolbar is shown in incorrect position when in-call status bar This closes #203 --- src/ios/CDVInAppBrowser.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m index 4646972..335e59c 100644 --- a/src/ios/CDVInAppBrowser.m +++ b/src/ios/CDVInAppBrowser.m @@ -29,6 +29,7 @@ #define kInAppBrowserToolbarBarPositionTop @"top" #define TOOLBAR_HEIGHT 44.0 +#define STATUSBAR_HEIGHT 20.0 #define LOCATIONBAR_HEIGHT 21.0 #define FOOTER_HEIGHT ((TOOLBAR_HEIGHT) + (LOCATIONBAR_HEIGHT)) @@ -1041,11 +1042,11 @@ - (void) viewDidLoad { - CGRect frame = [UIApplication sharedApplication].statusBarFrame; - + CGRect statusBarFrame = [self invertFrameIfNeeded:[UIApplication sharedApplication].statusBarFrame]; + statusBarFrame.size.height = STATUSBAR_HEIGHT; // simplified from: http://stackoverflow.com/a/25669695/219684 - UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:[self invertFrameIfNeeded:frame]]; + UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:statusBarFrame]; bgToolbar.barStyle = UIBarStyleDefault; [bgToolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; [self.view addSubview:bgToolbar];