Reputation: 637
I'm working in a UICollectionView
and I'm using the "Setion Header" option, everything is working fine except that in landscape mode the iPhone X does not fill completely.
I tried to find a solution for example with this but it does not work for me:
if #available(iOS 11.0, *) {
myCollection?.contentInsetAdjustmentBehavior = .always
}
Any suggestions on this?
In portraid it looks good:
Order of my views:
Upvotes: 3
Views: 370
Reputation: 4896
You can use size classes for it.
In Storyboard click on view as
at the bottom :
and change the orientation to landscape.
Select the trailing constraint of collectionView
:
introduce the variation for the constraint for compact-compact
as -44.
The final UI will be :
Repeat the same process for leading constraint. Hope it helps what you want to achieve here. Happy coding
Edit
Googled and got the same question in SO:
May be this helps what you want to achieve.
Upvotes: 2
Reputation: 1560
Remove Leading trailing constraints and add Leading and trailing constraints 0 from view not from safe area for your collection view.
Upvotes: 1