Using NavigationLink in Menu (SwiftUI)
问题 Can you use a NavigationLink as a Menu 's item in swiftUI? It seems to do just nothing: Menu { NavigationLink(destination: Text("test1")) { Text("item1") } NavigationLink(destination: Text("test2")) { Text("item2") } } label: { Text("open menu") } In case it is meant to not work as tried above, is there an alternative way of achiving the intended reult? 回答1: NavigationLink should be inside NavigationView hierarchy. The Menu is outside navigation view, so put buttons inside menu which activate