SwiftUi - 隐藏“后退”按钮和导航栏(出现几分之一秒)

eug*_*prg 5 navigationbar swiftui navigationlink swiftui-navigationlink

我使用此代码来隐藏导航栏和后退按钮,但是当加载视图时,我仍然可以看到后退按钮一小会儿,然后它就消失了。有什么办法可以阻止它被显示吗?

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

先感谢您,

Asp*_*eri 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("")
    }
}
Run Code Online (Sandbox Code Playgroud)