I am using xcode 13.2.1 iOS 15,i want to hide the navigational bar and the back arrow i have tried several methods. none of the answers worked
var body: some View {
NavigationView{
ZStack{
Text("Header") //Header View
Spacer ()
Text("Main")//Main View
Spacer()
Spacer()
Text("Bottom") //Bottom View
}.navigationTitle("")
.navigationBarHidden(true)
}.navigationViewStyle(.stack)
}
I fixed this on xcode 12.5 by adding this:
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
UIApplication.shared.isStatusBarHidden = true // <== ADD THIS LINE
return true
}
}
and then under info.plist I added
<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
using xml type.
Also I had .navigationBarHidden(true)
on the upmost level in the view, so for you, the NavigationView.