导航链接在整个列表上处于活动状态,而不仅仅是一个视图
我有以下视图:
List {
VStack {
InnerVStack {
...
}
InnerVStack {
...
Cell()
.background {
NavigationLink()
}
...
}
}
}
问题是,每当敲击整个vstack
时,navigationLink
就会激活。
我已经看到更多的人处理同样的问题,但确实无
济-EATE-element“> navigationLink内部列表中的ness insiral列表适用于hstack,而不是每个元素
列表,其中包含vStack的vStack可以使VSTACK TAPPABLE的整个区域而不仅仅是子视图
我想实现此类行为,只有当单元
被轻拍时,navigationLink
被激活,将用户重定向到另一个场景。
I have the following view:
List {
VStack {
InnerVStack {
...
}
InnerVStack {
...
Cell()
.background {
NavigationLink()
}
...
}
}
}
The problem is, that whenever the whole VStack
is tapped, the NavigationLink
is activated.
I have seen some more people deal with the same problem, but really to no avail:
NavigationLink inside List applies to HStack instead of each element
I want to achieve such behavior, that only when Cell
is tapped, then the NavigationLink
is activated and user is redirected to another scene.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论