-
-
Save fitomad/2fab102398cf7f7f5009805465e87ac7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal struct HorizontalGridView: View | |
{ | |
//Definimos las filas que tendrá cada columna | |
var rows: [GridItem] = Array(repeating: .init(.flexible()), count: 5) | |
internal var body: some View | |
{ | |
ScrollView([ .horizontal ], showsIndicators: false) | |
{ | |
LazyHGrid(rows: rows, alignment: .center, spacing: 8) | |
{ | |
ForEach(0 ..< 43) { number in | |
Text("\(number)") | |
.font(.title) | |
.frame(width: 100) | |
.frame(maxHeight: .infinity) | |
.background(number.isEven ? Color.orange : Color.purple) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment