Last active
June 24, 2020 11:09
-
-
Save prafullakumar/1511acd0fd4cbce28bf5929201fac2dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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 collums = [ | |
/// define number of caullum here | |
GridItem(.flexible()), | |
GridItem(.flexible()) | |
] | |
var body: some View { | |
ScrollView(.vertical) { //set .horizontal to scroll horizontally | |
LazyVGrid(columns: collums) { // use HGrid to layout horizontally | |
ForEach(0...50, id: \.self) { i in | |
Text("Grid: \(i)").frame(width: 100, height: 100, alignment: .center) | |
} | |
} | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment