I want to place 6 cells in two rows and having spacing = 1 between cells, I have tried the minimalLineSpacing method but it works between cells not between rows. Is there any trick or suggestions to achieve that? here is what i have tried so far:
and
Asked
Active
Viewed 126 times
0

Ulugbek
- 127
- 3
- 15
-
Check these links:- 1. https://stackoverflow.com/questions/28325277/how-to-set-cell-spacing-and-uicollectionview-uicollectionviewflowlayout-size-r 2. https://stackoverflow.com/questions/28386506/remove-space-between-sections-in-collectionview – Nexus Mar 17 '20 at 16:31
1 Answers
0
// spacing between cells
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return cellSpacing
}
// spacing between rows
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return cellSpacing
}

Toto
- 593
- 7
- 20