【发布时间】:2020-10-25 13:12:11
【问题描述】:
我正在尝试从工作表视图转到另一个页面。这是第一个视图的代码:
struct FirstView: View {
@State fileprivate var isShowingSheet: Bool = false
var body: some View {
Button(action: {
isShowingSheet = true
}) {
Text("Show the sheet")
}
.sheet(isPresented: $isShowingSheet, content: {
SecondView()
})
}
}
这是第二个视图的代码:
struct SecondView: View {
var body: some View {
NavigationLink(destination: ThirdView()) {
Text("Show the third view.")
}
}
}
问题是第三个视图也将在该表中。是否可以使第三个视图成为普通页面而不是工作表中的视图?
谢谢!
【问题讨论】:
标签: ios swift swiftui swiftui-navigationlink