0
votes

I have a UICollectionView, using the basic flow layout. I've implemented the insetForSectionAtIndex method, returning a UIEdgeInsets with top and bottom insets, as well as the left and right:

- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {

    return UIEdgeInsetsMake(2.0f, 2.0f, 2.0f, 2.0f);
}

The result is that there is 2.0f "padding" on the left and right of each cell, but no "padding" on the top and bottom. It's flush (0.0f). What am I missing?

Thanks.

1

1 Answers

0
votes

Without more code, it's hard to help.

How many sections do you have? If it's more than 1 then you may need to set the spacing between sections too.

The other possibility that comes to mind is that the content of the UICollectionViewCells is bigger than the size that yo've assigned to it.