how can I get the actual interItemSpacing
for a horizontal flow layout in the UICollectionView
? the only info I can get (and set) is minimumInteritemSpacing
.
I need it for the sake of the following small calculation to always display 3 equally width items in the collection view regardless to screen size (i want to replace minimumInteritemSpacing
with the current value of interItemSpacing in the formula):
flowLayout.itemSize = CGSizeMake((_collectionView.frame.size.width/3.0)-(flowLayout.minimumInteritemSpacing/3.0), _collectionView.frame.size.height);
I put this calculation in viewDidLayoutSubviews
and it's not working precisely for some screens because their current interItemSpacing
is different than the minimumInteritemSpacing
thanks in advance.