UICollectionView io11 - top inset

Viewed 586

Guys, I'm migrating my app in ios-11, and I can't manage to make my UICollectionView full screen. So, I went through StackOverflow, as we all do, and I found these 2 topics :

  1. Uncheck Safe Area Relative Margins of the superView

  2. Set de Content Inset to None instead of Automatic

These 2 tricks worked pretty well for all my UISrollViews

and UITableViews in my project, But not for UICollectionView.

Do you guys have any idea? Thanks.

iPhone X iPhone 8

1 Answers

To change how the safe area is applied, modify the contentInsetAdjustmentBehavior property.

collectionView.contentInsetAdjustmentBehavior = .never
Related