我想在点击图像时推送视图。到目前为止我的代码:
struct Home: View {
var body: some View {
NavigationView {
VStack {
Image("image")
.onTapGesture {
//navigation code here
}
Text("Tap on image to find details")
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
如何实现这样的导航呢?谢谢!
为什么不能使用如下标准的 NavigationLink?
NavigationView {
VStack {
NavigationLink(destination: SomeDestinationViewHere()) {
Image("image")
}
Text("Tap on image to find details")
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4351 次 |
| 最近记录: |