我将项目嵌入导航链接的列表(行)中
我的物品变成了蓝色click
这是我的代码:
ToysRow.swift
struct ToyRow: View {
var category: String
var toys:[Toy]
var body: some View {
Group {
VStack{
VStack(alignment: .leading){
Text(category).padding().font(.largeTitle)
ScrollView(.horizontal, showsIndicators: false){
HStack(alignment: .top){
ForEach(self.toys){
toy1 in
NavigationLink(destination: ToyDetail(toy: toy1)) {
ToyItem(toy: toy1)
}.padding()
}
}
}
}
}
}
}
}
因此创建NavigationView无效–变成灰色