相关疑难解决方法(0)

SwiftUI关闭模态

由于SwiftUI是声明性的,因此没有dismiss方法。如何在上添加一个关闭/关闭按钮DetailView

struct DetailView: View {
  var body: some View {
  Text("Detail")
  }
}

struct ContentView : View {
  var body: some View {
  PresentationButton(Text("Click to show"), destination: DetailView())
  }
}
Run Code Online (Sandbox Code Playgroud)

modal-dialog swift swiftui

27
推荐指数
9
解决办法
8731
查看次数

标签 统计

modal-dialog ×1

swift ×1

swiftui ×1