UICollectionView - add bottom inset for entire collectionView

906 Views Asked by At

I have a UICollectionView with multiple sections.

I would like to add bottom inset to the entire collectionView.

All the Q&As suggest to use the following function:

func collectionView(_ collectionView: UICollectionView, 
                  layout collectionViewLayout: UICollectionViewLayout, 
       insetForSectionAt section: Int) -> UIEdgeInsets

But this adds insets to all the sections. Where I need space only it the bottom of the collectionView

1

There are 1 best solutions below

0
Shehata Gamal On BEST ANSWER

You can try

collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom:<#someValue#>, right: 0)