[ad_1]
I’m attempting to determine take away the padding I get after I use UIHostingConfiguration
to make use of a SwiftUI view in a UICollectionView
. For instance utilizing this code:
https://github.com/mvemjsun/CollectionView
If I add a border to the CellView
:
/// Create a cell registration of sort UICollectionViewCell with `ToDoListItem` that can be used to offer the gathering view cells.
/// This can
let cellRegistration = UICollectionView.CellRegistration<UICollectionViewCell, ToDoListItem> { cell, indexPath, merchandise in
cell.contentConfiguration = UIHostingConfiguration {
CellView(toDoListItem: merchandise)
.border(.crimson) // <-- I added this to point out the padding in between I wish to take away....
}
}
It reveals the padding I’m speaking about:
I’ve the identical conduct in different initiatives. I need the SwiftUI view inside UIHostingConfiguration
closure to fill the whole area of the cell in order that on this case that crimson border would by proper subsequent to the following cell and never have the hole in between cells…
How can I try this?
[ad_2]