I'm trying to adapt my universal app for different orientations and layouts. I have a UICollectionView with a custom layout.
Whenever the size class changes (especially when switching between full screen and slide over on iPad), the
contentOffset
gets messed up. I've put in some break points and found that the contentOffset
is being set from a private method [UIScrollView(UIScrollViewInternal) _adjustContentOffset]
. I can prevent this behaviour by overriding _adjustContentOffset
and not calling super, however I'm not sure if this is considered using a private API; regardless, its probably not a good idea to completely remove that function. I also tried setting
automaticallyAdjustsScrollViewInsets = NO
on the UIViewController, but it has no effect. Is there a proper way to disable the contentOffset adjustment?