When the UICollectionView is populated with items they always go right to the edges of the UICollectionView like so:
---------------
|X X X X X X X|
|X X X X
You can pretty much control every aspect of the grid with collectionview's protocol. Here's an example:
- (UICollectionViewFlowLayout *)collectionViewFlowLayout
{
UICollectionViewFlowLayout *flowLayout = [UICollectionViewFlowLayout new];
flowLayout.itemSize = CGSizeMake(180, 255);
flowLayout.sectionInset = UIEdgeInsetsMake(10, 30, 0, 30);
flowLayout.minimumInteritemSpacing = 0.0f;
flowLayout.minimumLineSpacing = 0.0f;
flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
return flowLayout;
}
The one you would want to change in your case is the sectionInsets