I am creating a UICollectionView which scrolls horizontally but with a vertical section header.
My problem is that for horizontal scrolling, the section header defaults to the left side of the collection view and I cannot adjust it to the top of the UICollectionView.
I have checked out various solutions which includes DateFlowLayout which unfortunately does not work anymore.
You have to implement your own collection view layout to do so.
The easiest would be to subclass UICollectionViewFlowLayout and override
- (UICollectionViewLayoutAttributes *)layoutAttributesForSupplementaryViewOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath;
to give the frame you wish for the header
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With