This is an automated email from the ASF dual-hosted git repository.
GitToTheHub pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push:
new 36db6c31 doc(statusbar): Hide/Show mechanism for Mac Catalyst by
`HideDesktopTitlebar` (#1696)
36db6c31 is described below
commit 36db6c314e3dcd03671d3ba901de6b6adf3a942b
Author: Manuel Beck <[email protected]>
AuthorDate: Tue Aug 25 09:58:07 2026 +0200
doc(statusbar): Hide/Show mechanism for Mac Catalyst by
`HideDesktopTitlebar` (#1696)
- On Mac Catalyst when `HideDesktopTitlebar` is `false`,
`scrollView.contentInsetAdjustmentBehavior` will be set to
`UIScrollViewContentInsetAdjustmentNever`, which hides the status bar in
`scrollViewDidChangeAdjustedContentInset:`. This what not obvious, when
insepcting the line `self.statusBar.hidden =
(scrollView.contentInsetAdjustmentBehavior ==
UIScrollViewContentInsetAdjustmentNever);` on
`scrollViewDidChangeAdjustedContentInset:`
---
CordovaLib/Classes/Public/CDVViewController.m | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CordovaLib/Classes/Public/CDVViewController.m
b/CordovaLib/Classes/Public/CDVViewController.m
index b2dc5714..3c24d7b0 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -421,6 +421,9 @@ static UIColor *defaultBackgroundColor(void) {
if ([self.webView respondsToSelector:@selector(scrollView)]) {
UIScrollView *scrollView = [self.webView
performSelector:@selector(scrollView)];
+ // The web view is already constrained below the Mac Catalyst
title bar,
+ // so disable UIKit's automatic safe-area inset adjustment. The
status
+ // bar view is hidden for this mode in
scrollViewDidChangeAdjustedContentInset:.
scrollView.contentInsetAdjustmentBehavior =
UIScrollViewContentInsetAdjustmentNever;
}
}
@@ -583,6 +586,9 @@ static UIColor *defaultBackgroundColor(void) {
return;
}
+ // On Mac Catalyst, Cordova may manually constrain the web view below the
title bar.
+ // In that case automatic scroll-view inset adjustment is disabled, so the
synthetic
+ // status bar view should be hidden.
self.statusBar.hidden = (scrollView.contentInsetAdjustmentBehavior ==
UIScrollViewContentInsetAdjustmentNever);
#endif
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]