I am unable to programmatically hide status Bar

PLATFORM AND VERSION iOS Development environment: Xcode 16, macOS 15.0.1 Run-time configuration: iOS 18.1

DESCRIPTION OF THE PROBLEM I am experiencing inconsistent behaviour in SwiftUI when attempting to hide the status bar programmatically. Specifically, I want the status bar to be hidden only during the AreaQuizView, but the behaviour is not persistent across different views. On some views, the status bar hides correctly, while on others, it does not. I am using .statusBarHidden() to achieve this.

STEPS TO REPRODUCE

In AreasView, apply .statusBarHidden() to the outermost VStack. The status bar hides as expected.

In AreaQuizView, apply the same .statusBarHidden() to the outermost stack. However, in this view, the status bar remains visible.

In the Build Targets, if I set Status bar is initially hidden to YES in the info.plist, I lose control over the status bar entirely.

EXPECTED BEHAVIOUR I would expect that .statusBarHidden() would behave consistently across all views, allowing me to programmatically hide the status bar only during AreaQuizView and leave it visible for other views.

ADVICE REQUESTED Could you please advise on how to achieve the desired behaviour, where the status bar is only hidden during AreaQuizView? I would also appreciate any guidance on ensuring consistent behaviour across different views.

Please advise.

@jezekilj Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

@jezekilj This looks like a bug to me. Please file a bug report via Feedback Assistant and post the feedback number here. Thanks

Done under FB15811077.

I am unable to programmatically hide status Bar
 
 
Q