I have a simple code which displays the Array in Grid. Is it possible to show items as an ark shaped array based Upon available width and Item numbers.
import SwiftUI
struct ContentView: View {
let columns = [
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible()),
GridItem(.flexible())
]
var body: some View {
ScrollView {
LazyVGrid(columns: columns, spacing: 15) {
ForEach(0..<20) { number in
Rectangle()
.foregroundColor(Color.red)
.frame(width: 50, height: 80)
.cornerRadius(10)
.shadow(color: .black, radius: 5, x: 2, y: 2)
.overlay(
Text("\(number)").foregroundColor(.white)
)
}
}.padding(.all, 10)
}
}
}
Result is like this

I would like something like following image.

Thank you.
