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 43 times
0
![](../../users/profiles/11727808.webp)
Ulugbek
- 81
- 8
-
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
}
![](../../users/profiles/9710432.webp)
Toto
- 527
- 4
- 16