0

i am using swift 2.o uicollection view. I did all spacing for left, right,top,bottom,cell, line spacing as 8 px. But when i run in 5s my collection view is ok. But when i run my app in above 6,6s screen i am seeing many gap between each cell. I need four cell in each row..

here is my 5s screen :

enter image description here

Here is my 6 screen :

enter image description here

How can i set equal space like 5s screen for all screen Please help me out.

Thanks !

func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {

return CGSizeMake((self.view.frame.size.width/4) - 20, (self.view.frame.size.width/4) - 20);

    }
user5513630
  • 1,617
  • 6
  • 19
  • 40

1 Answers1

0

Use size classes for that. Click here for more information. Also set your item sizes with UICollectionViewFlowLayout.

Kemal Can Kaynak
  • 1,533
  • 13
  • 24