我正在使用此代码隐藏导航栏和“后退”按钮,但是在加载视图时,我仍然可以看到“后退”按钮一秒钟,然后消失。有什么办法可以防止它被显示?
var body: some View {
NavigationView {
NavigationLink(destination: DeferView { WeekView(journey: self.launcher.completeJourney!) }, isActive: self.$launcher.readyJourney ) { EmptyView () }
.navigationBarHidden(true)
.navigationBarTitle("")
}
}
先谢谢您
答案 0 :(得分:2)
还为链接目标添加相同的修饰符,
var body: some View {
NavigationView {
NavigationLink(destination: DeferView { WeekView(journey: self.launcher.completeJourney!) }
.navigationBarHidden(true) // here !!
.navigationBarTitle("") // here !!
, isActive: self.$launcher.readyJourney ) { EmptyView () }
.navigationBarHidden(true)
.navigationBarTitle("")
}
}