我想呈现模态视图,并在解雇后再次呈现它。
struct ContentView : View {
var body: some View {
NavigationView {
Group {
Text("hi")
Text("hello")
}
.navigationBarItem(title: Text("Demo"))
.navigationBarItems(trailing:
PresentationButton(
Image(systemName: "person.crop.circle")
.imageScale(.large)
.accessibility(label: Text("User Profile"))
.padding(),
destination: Text("User Profile")
)
)
}
}
}
它仅在第一次点击时触发。关闭目的地视图后,点击PresentationButton
什么也不做。有人有解决方案吗?