Reputation: 51
I have an array with 13 items and I'm trying to build LazyHGrid
with two rows, 7 in the first and 6 in the second row. The second row must be centered inside LazyHGrid
. Like this:
I set alignment to GridItem to .center like this:
LazyHGrid(rows: [GridItem(.flexible()), GridItem(.flexible(), alignment: .center)], alignment: .center, spacing: 20) {
ForEach(0..<13) { number in
Letter(text: self.tray[number], index: number, isTop: true, onChanged: self.letterMoved, onEnded: self.letterDropped)
}
}
But anyway it doesn't help and my result looks like this:
Is it possible to build LazyHGrid
in this way?
Upvotes: 4
Views: 1120