I wanted to create a grid of cells with no spaces or smaller space just like the Photos app, is it possible with SwiftUI 2 LazyVGrid? I've tried it but there is always this space in-between columns.
In the documentation, the spacing parameter is described as:
Which doesn't make much sense, can't you just use padding for that? Also, when I tried increasing the spacing, it seems to be actually impacting the space in-between rows of cells, which is even more unexpected.
In the documentation, the spacing parameter is described as:
https://developer.apple.com/documentation/swiftui/lazyvgrid/init(columns:alignment:spacing:pinnedviews:content:)spacing
The spacing beween the grid and the next item in its parent view.
Which doesn't make much sense, can't you just use padding for that? Also, when I tried increasing the spacing, it seems to be actually impacting the space in-between rows of cells, which is even more unexpected.
Got an answer on StackOverflow, I missed the docs for GridItem: https://developer.apple.com/documentation/swiftui/griditem
It also has a spacing parameter that controls the spacing between items, the documentation on grid should be clearer on the meaning of its spacing is not really the spacing between the grid and the next item, but the vertical spacing between grid rows.
It also has a spacing parameter that controls the spacing between items, the documentation on grid should be clearer on the meaning of its spacing is not really the spacing between the grid and the next item, but the vertical spacing between grid rows.