Currently, I am using UICollectionViewCompositionalLayout
to achieve the following list layout with spacing:
We were thinking of trying out UICollectionLayoutListConfiguration
due to its ability to support swipe actions.
We would like to specify the spacing between each item. However, I do not find a way to specify item spacing in UICollectionLayoutListConfiguration
.
Does UICollectionLayoutListConfiguration
not support item spacing, or have I missed something?
Thanks.
The list layout is basically intended to simulate (or perhaps even replace) a table view. So the way to get the spacing you’re after is the same as what you would do to get that sort of spacing with a table view: draw the colored rectanges with a vertical inset, top and bottom, from the actual cell. The cell itself is transparent, so the effect is the same.
1