This is an automated email from the ASF dual-hosted git repository. GitToTheHub pushed a commit to branch pr-doc-ios-mac-catalyst-HideDesktopTitlebar in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
commit b2c3ff8f5ef672c1e6f22b6f91cfcc93e67441e7 Author: Manuel Beck <[email protected]> AuthorDate: Mon Aug 24 17:41:36 2026 +0200 doc(statusbar): Hide/Show mechanism for Mac Catalyst by `HideDesktopTitlebar` - 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]
