1

I set the cell size in

collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath).

However, in other callbacks of the collectionView I see that the flowLayout.itemSize is not the size I set, despite the size being correctly rendered on screen. Why is this not the case?

Separate but related-how/where do I set the flowLayout.minimumInteritemSpacing?

AlexK
  • 336
  • 8
  • 21
  • 41

1 Answers1

0

So my answer might be kind of hack-ish but it works perfectly for me.

In

collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath)

before I return I set the flowLayout.itemSize and minimumInteritemSpacing (in my case 1/6 the item size). Now whenever I call these I get the desired values.

AlexK
  • 336
  • 8
  • 21
  • 41