In this code, I have filter tags. They are displayed in a horizontal ScrollView. I want to spread the tags over 3 rows so that more of them are in view without needing to scroll.
How do I do this?
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(tagData, id: \.self) { tag in
Button {
print("Tag Tapped...")
} label: {
BusinessFilterTag(filterSelected: $filterSelected, businessTagData: tag )
}
.background(
Capsule()
.stroke(Color("AshGray"), lineWidth: 2)
.padding(4)
.background(
Capsule()
.fill(selection == tag.id ? Color("LightBlue").opacity(0.6) : Color.clear)
.padding(4)
)
)
}
}
}