From 8da38f5075ac165ea80fee39dc14f807a343c590 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Wed, 27 Dec 2017 16:43:58 +0100 Subject: [PATCH] CB-13712 (iOS): fix overlaysWebView reset on rotation (#92) --- src/ios/CDVStatusBar.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m index 37fb7cb..c67f137 100644 --- a/src/ios/CDVStatusBar.m +++ b/src/ios/CDVStatusBar.m @@ -97,8 +97,12 @@ static const void *kStatusBarStyle = &kStatusBarStyle; -(void)statusBarDidChangeFrame:(NSNotification*)notification { - [self resizeStatusBarBackgroundView]; - [self resizeWebView]; + //add a small delay ( 0.1 seconds ) or statusbar size will be wrong + __weak CDVStatusBar* weakSelf = self; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [weakSelf resizeStatusBarBackgroundView]; + [weakSelf resizeWebView]; + }); } - (void)pluginInitialize