How to modify the flow layout, so that there is the same vertical spacing between the smaller and larger cells (eg. there is no fixed row height / the row height is not fixed to the maximal size)?
I want to look it like this
How to modify the flow layout, so that there is the same vertical spacing between the smaller and larger cells (eg. there is no fixed row height / the row height is not fixed to the maximal size)?
I want to look it like this
The solution was using UICollectionViewWaterfallLayout
Follow the setup from the website, and you can setup it like this
- (void)viewDidLoad
{
[super viewDidLoad];
UICollectionViewWaterfallLayout * layout = (UICollectionViewWaterfallLayout *)self.collectionView.collectionViewLayout;
layout.delegate = self;
layout.columnCount = 2;
layout.itemWidth = 150.f;
layout.sectionInset = UIEdgeInsetsZero;
...
}