我想以模态视图的方式呈现内容,然后在关闭后再次以同样的方式呈现。
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
不起作用。 有人有解决方案吗?
它只会在第一次点击时触发。在关闭目标视图后,再次点击PresentationButton
没有任何反应。是否有人有解决方法?