Due to application specific reasons I have to nest a TabView in a NavigationView. But then the navigation bar title of the tab items doesn't get displayed, just an empty navigation bar.
Any solutions to this?
struct ContentView: View {
var body: some View {
NavigationView {
TabView {
Text("Tab 1")
.navigationBarTitle("Tab 1") // is ignored, only an empty string is displayed
.tabItem {
Text("Tab 1")
}
Text("Tab 2")
.navigationBarTitle("Tab 2") // is ignored, only an empty string is displayed
.tabItem {
Text("Tab 2")
}
}
// this would display a navigation bar title, but then the title is the same for all tab items
//.navigationBarTitle("TabView title")
}
}
}