Underneath iOS15, `part.contentInsets` shouldn’t be utilized in A `_UICollectionViewOrthogonalScrollerEmbeddedScrollView`


We use UICollectionViewCompositionalLayout to structure our web page.

When creating a piece, the contentInsets property is ready:

part.contentInsets = .init(high: 0, main: 16, backside: 0, trailing: 16)

In iOS 15 and above, the ultimate result’s nice, as proven within the following picture:

enter image description here

Nonetheless, in variations beneath iOS15 (e.g. iOS14), part.contentInsets doesn’t work on _UICollectionViewOrthogonalScrollerEmbeddedScrollView. The impact is proven within the following determine:

enter image description here

How can I write code to make _UICollectionViewOrthogonalScrollerEmbeddedScrollView behave the identical as iOS15 in techniques beneath iOS15?

That is essential to me as a result of I have to get the _UICollectionViewOrthogonalScrollerEmbeddedScrollView and set its clipsToBounds property to true to attain the "content material scrolls solely throughout the white space " impact.


Leave a Reply