Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created June 23, 2020 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/b23f470d17864cdbf62503d01e3f9821 to your computer and use it in GitHub Desktop.
Save fitomad/b23f470d17864cdbf62503d01e3f9821 to your computer and use it in GitHub Desktop.
internal struct VerticalGridView: View
{
// Definición de las columnas que tendrá cada fila
var columns: [GridItem] = Array(repeating: .init(.flexible()), count: 3)
internal var body: some View
{
ScrollView([ .vertical ], showsIndicators: false)
{
LazyVGrid(columns: columns, alignment: .center, spacing: 8)
{
ForEach(0 ..< 44) { number in
Text("\(number)")
.font(.title)
.frame(height: 100)
.frame(maxWidth: .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