From 41a77f532bc21e009cd68b87a4131c2841265491 Mon Sep 17 00:00:00 2001 From: Nashuim Date: Fri, 13 Dec 2024 10:18:47 +0000 Subject: [PATCH] Handle resize issues --- src/ios/CDVStatusBar.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m index 9d8acfa..c23a8eb 100644 --- a/src/ios/CDVStatusBar.m +++ b/src/ios/CDVStatusBar.m @@ -105,8 +105,8 @@ static const void *kStatusBarStyle = &kStatusBarStyle; //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]; + [weakSelf resizeStatusBarBackgroundView]; }); } @@ -423,6 +423,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle; -(void)resizeStatusBarBackgroundView { CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame; + statusBarFrame.size.height = self.webView.frame.origin.y; // Set the height to the current webView origin in case it has been changed after resizing CGRect sbBgFrame = _statusBarBackgroundView.frame; sbBgFrame.size = statusBarFrame.size; _statusBarBackgroundView.frame = sbBgFrame; @@ -445,7 +446,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle; float safeAreaTop = self.webView.safeAreaInsets.top; if (!self.statusBarOverlaysWebView) { - frame.origin.y = height >= safeAreaTop ? height : safeAreaTop; + frame.origin.y = height >= safeAreaTop || height == 0 ? height : safeAreaTop; } else { if (height >= safeAreaTop && safeAreaTop >0) { // Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20