-
-
Save anupamchugh/99866e9700d48ddb517bc28db36ca760 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
struct ContentView: View { | |
let colors: [Color] = [.red, .green, .yellow, .blue] | |
var columns: [GridItem] = | |
Array(repeating: .init(.flexible(), alignment: .center), count: 3) | |
var body: some View { | |
ScrollView { | |
LazyVGrid(columns: columns, spacing: 10) { | |
ForEach(0...100, id: \.self) { index in | |
Text("Tab \(index)") | |
.frame(width: 110, height: 200) | |
.background(colors[index % colors.count]) | |
.cornerRadius(8) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment