Issue of navigationBarHidden

Hello everyone.

I am new to Swift and SwiftUI, and I have got in trouble with the modifier .navigationBarHidden(), which doesn't work consistently if I click from a page called .navigationBarHidden(true) to a page with .navigationBarHidden(false) and then go back. The navigation bar on the second page will hide sometimes without any signs.

Are there any better practices to control the state of the navigation bar to prevent the above issue? Thanks a lot!
Could you show the code with all the places where you apply navigationBarHidden() modifier.

How you apply it is critical:
https://stackoverflow.com/questions/59027529/swiftui-navigation-bar-hide-is-not-working

Note: you tagged as Swift. It is purely a SwiftUI question.
put .navigationBarHidden(true) modifier on the parent container inside your NavigationView


  NavigationView{
      VStack{
         
      }.navigationBarTitle(Text("Hi"))
      .navigationBarHidden(true)
    }

I had exactly the same issue. It did not matter where I placed ,,navigationBarHidden(true)'', it would not work. Apparently it is a bug with IOS15. Now that I have IOS16 the issue is gone, without changing any code. I know you posted the question a while ago, but maybe that helps.

Issue of navigationBarHidden
 
 
Q