Hi working on this book but confused at this point
struct ContentView: View {
let gridItems: [GridItem] = [
GridItem(.fixed(100)),
GridItem(.fixed(100)),
GridItem(.fixed(100))
]
var body: some View {
LazyVGrid (columns: gridItems) {
ForEach(1..<100){ i in Color.red}
}
}
}
“So, that’s a vertical grid using our three-column structure, and inside that are 99 rows containing the color red – nothing more. When you run that project you’ll notice a few things:
1 The grid runs edge to edge in our window.”
Sadly what I notice is not that. Instead what I get is a resizable window
Second adding Scroll View does nothing,
Third adding lots and lots and lots of columns doesnt give you scrolling either. Here is the dotty code I used to test that
struct ContentView: View {
let gridItems: [GridItem] = Array(repeating: GridItem(.fixed(100)), count:15)
]
var body: some View {
ScrollView{
LazyVGrid (columns: gridItems) {
ForEach(1..<1000){ i in Color.red}
}
}
}
}