1

I have a UICollectionView where I want this:

[    x    x    ]
[    x    x    ]

Each UICollectionViewCell is 120x120 using:

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    return CGSizeMake(120, 120);
}

I cannot figure out how to make the two columns center. With the same amount in the left, middle and right.

Can you help me out with this?

Thanks!

Jason Silberman
  • 2,471
  • 6
  • 29
  • 47

1 Answers1

1

Use sectionInset to dictate the margins. Use minimumInteritemSpacing to determine the space between the items.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Those are the limits of the customizability of the built-in UICollectionViewFlowLayout. As I've indicated in my comment above, what you really want to do is subclass UICollectionViewFlowLayout. – matt Mar 22 '14 at 17:05