I'm using SwiftUI TabView
inside NavigationView
, But I just can't hide the navigation bar in iOS 13.0 simulator.
Here is the code:
import SwiftUI
struct TestView: View {
var body: some View {
ZStack {
Color.green
Text("Hello")
}
}
}
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
Color.red
TabView(selection: .constant(0),
content: {
TestView()
.tabItem { Text("test") }
.tag(0)
.navigationBarTitle("")
.navigationBarHidden(true)
})
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Any help? thanks!