swiftUI NavigationLink 没有带我到正确的视图

swiftUI NavigationLink not taking me to the correct View

我有以下内容:

        ScrollView(.horizontal, showsIndicators: false) {
            HStack {
                ForEach(events) { event in
                        VStack {
                            Image(event.image)
                                .resizable()
                                .aspectRatio(contentMode: .fill)
                                .frame(width: 100, height: 100)
                                .padding(55)
                            NavigationLink(destination: PostView()) {
                            Text(event.name)
                                .font(.system(.headline))
                                .padding(.bottom,20)
                            }
                        }
                        .padding()
                        .border(Color.black, width: 4)
                        .cornerRadius(10)

                }
            }
        }

但是 NavigationLink NavigationLink(destination: PostView()) { 没有将我带到正确的视图?

我已经尝试将 NavigationLink 包裹在每个 VStack 周围,但这也没有带我到视图

我认为你没有使用 "NavigationView"。

NavigationView{
        ScrollView(.horizontal, showsIndicators: false) {
            HStack {
                ForEach((1...10).reversed(), id: \.self) {_ in
                        VStack {
                            NavigationLink(destination: PostView()) {
                            Text("event.name")
                                .font(.system(.headline))
                                .padding(.bottom,20)
                            }
                        }
                        .padding()
                        .border(Color.black, width: 4)
                        .cornerRadius(10)

                }
            }
        }
    }