3

我正在使用此代码隐藏导航栏和后退按钮,但是当加载视图时,我仍然可以在几分之一秒内看到后退按钮,然后它就消失了。有什么方法可以防止它被显示吗?

var body: some View {
    NavigationView {
        NavigationLink(destination: DeferView { WeekView(journey: self.launcher.completeJourney!) }, isActive: self.$launcher.readyJourney ) { EmptyView () }
        .navigationBarHidden(true)
        .navigationBarTitle("")
    }
}

先感谢您,

4

1 回答 1

4

也为链接目的地添加相同的修饰符,

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("")
    }
}
于 2020-06-02T17:58:28.187 回答