Skip to content

Commit fb13a38

Browse files
authored
fix(statusbar): using window size instead of screen size for resize bounds (#2394)
1 parent 7c53a4c commit fb13a38

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

status-bar/ios/Sources/StatusBarPlugin/StatusBar.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,17 @@ public class StatusBar {
124124
}
125125

126126
private func resizeWebView() {
127+
var bounds: CGRect? = nil
128+
129+
if #available(iOS 15.0, *) {
130+
bounds = bridge.viewController?.view.window?.windowScene?.keyWindow?.bounds
131+
} else {
132+
bounds = bridge.viewController?.view.window?.windowScene?.screen.bounds
133+
}
134+
127135
guard
128136
let webView = bridge.webView,
129-
let bounds = bridge.viewController?.view.window?.windowScene?.screen.bounds
137+
let bounds = bounds
130138
else { return }
131139
bridge.viewController?.view.frame = bounds
132140
webView.frame = bounds

0 commit comments

Comments
 (0)