Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Left padding on first item in UICollectionView with UICollectionViewFlowLayout

I'm using a UICollectionView with a UICollectionViewFlowLayout to try and achieve left padding/margin on the first item in the view only. I've looked at all the instance attributes and methods for each and can't seem to find one that helps.

To be clear, I still want the view to be scrollable the entire width of the app, so simply moving the surrounding frame isn't going to help.

like image 814
Josh Smith Avatar asked Feb 15 '23 22:02

Josh Smith


1 Answers

To do what I want I needed to set the headerReferenceSize of the UICollectionViewFlowLayout to have a 10px width.

like image 187
Josh Smith Avatar answered Apr 09 '23 10:04

Josh Smith