I am trying to set the padding to zero in the collection view cells, I set the "Min Interval" on the view controller:

However, it still has gaps between the cells:

I would also like the cells to be well tolerated depending on the frame width, for example, each cell has a width of 50 pixels, so if there are six cells, and I set the frame width to 150 pixels, it will display two lines of three cells.
However, if I set the frame width to 150 by doing:
- (void)viewDidLoad { [super viewDidLoad]; CGRect frame = self.collectionView.frame; frame.size.width = 150; self.collectionView.frame = frame; }
It looks like in the above screenshot (too wide).
If I put it on something ridiculously small, such as 10, it will turn around to some extent:

UICollectionViewCell is set to 50 x 50:

I also tried setting the cell size programmatically, and also uninstalled UIEdgeInset:
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { return UIEdgeInsetsMake(0, 0, 0, 0); }
I turned off auto-linking only if you had any interference. Any tips on how I can remove the gasket and also wrap them depending on the width / height of the frame?
objective-c uicollectionview uicollectionviewcell
Stur
source share