I'm still learning to SwiftUI and am playing with the NavigationView and I am able to hide the top navigation bar in portrait mode but have two issues.
1.) In landscape mode, there's a top bar that still sits on top of the view. Pulling it down brings down the notification center/settings
2.) After tapping the button in the view, it moves to the DetailView, but the top navigation bar is loaded briefly and then hides. How to stop the navigation from loading.
GIF of button to next view - the flow from tapping button to moving to next view to changing to landscape mode
Any feedback or approach is appreciated. Thanks!
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
NavigationLink(destination: DetailView()) {
Text("Hello World")
.fontWeight(.bold)
.font(.title)
.padding()
.background(Color.blue)
.cornerRadius(40)
.foregroundColor(.blue)
.padding(10)
.overlay(
RoundedRectangle(cornerRadius: 40)
)
}
.navigationBarTitle("", displayMode: .inline)
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
//.edgesIgnoringSafeArea([.top, .bottom])
//.navigationViewStyle(StackNavigationViewStyle())
//.navigationViewStyle(DoubleColumnNavigationViewStyle())
}
}
.navigationBarTitle("", displayMode: .inline)
.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)
//.statusBar(hidden: true)
}
}