try? it out
import SwiftUI
struct DetailView: View {
var body: some View {
Text("Detail View")
.navigationBarTitleDisplayMode(.inline)
.navigationTitle("Detail View")
}
}
struct ContentView: View {
var body: some View {
NavigationStack {
NavigationLink("Show detail view") {
DetailView()
}
.navigationTitle("Home View")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}