在我的SwiftUI应用程序上,正常导航会导致我感到奇怪的崩溃
我有一个简单的标签视图:
struct FFTabView: View {
var body: some View {
TabView {
libraryView2()
}
.navigationBarBackButtonHidden(true)
.navigationBarHidden(true)
.navigationBarTitle("",displayMode: .inline)
}
}
// MARK: -
struct libraryView2: View {
var body: some View {
VStack {
NavigationLink(destination: Foo()) {
Text("go to foo")
}
}
.tabItem {
Image(systemName: "square.grid.2x2.fill")
Text("Skill library")
}
}
}
struct Foo: View {
var body: some View {
Text("foo view")
}
}
当我通过导航栏返回时,从Foo
崩溃:Tried to pop to a view controller that doesn't exist
知道这里发生了什么吗?我找不到与此和SwiftUI相关的任何内容,因此我想发布。谢谢