I want to reduce the size between cells in row. Now it looks like:
I'm trying this, for reduce the size between them:
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
layout.sectionInset = UIEdgeInsets(top: 20, left: 2, bottom: 10, right: 2)
layout.minimumInteritemSpacing = 0
layout.minimumLineSpacing = 0
but it doesn't help me. What I do wrong?
If you create
CollectionView
InStoryBoard
orXib
,Go toStoryBoard
orXib
and set these Values fromSwift 5 Programmatically
You can provide much more customization inside the
lazy collectionView
Block.On your code, you have to create a IBOutlet to your collection view, and then assign the collectionViewLayout as such:
Its simple