0

I'm trying to create a static UICollectionView with 3 rows and 2 columns

I calculated the width of cell by dividing screen width into two

([[UIScreen mainScreen] bounds].size.width)/2

Now I don't want cell height to exceed UICollectionView height

How do i calculate this ?

I tried getting frame height of UICollectionView and divide it by 3 but it's not totally correct

int height = collectionView.frame.size.height/3;

What is the correct way to give a static height of the cell without exceeding UICollectionView height ?

Jack
  • 13,571
  • 6
  • 76
  • 98
Osa
  • 1,922
  • 7
  • 30
  • 51

1 Answers1

0

I think you are missing the fact that a collectionView needs more information about its items like: section insets, minimum spacing between cells, minimum spacing between lines (rows) and then, when you have all this data into account you can proceed to calculate the sizes that fit your needs. It may be helpful if you provide some more information about your issue, images for instance.