iOS 11 causing my UINavigationController transitions to slide up

When updating my project for iOS 11, I am having strange transitions when pushing and popping views on a UINavigationController. The entire view seems to have an offset, and will slide up or slide down. Swiping from the side I can slowly see this transition happen, and it is unwanted.


I have found one other reference to this: https://stackoverflow.com/questions/45715224/preventing-uinavigationcontroller-transitions-animating-upwards-with-an-offset-i


I have changed my ViewControllers to use Safe Area Layout guides, but it doesn't seem to help the issue. Here is a screen caputure of the issue: https://youtu.be/7qzgNeLOZqk


What do I need to change for iOS 11 to fix this issue?

Accepted Reply

Figured it out!


After some research ...I found that `automaticallyAdjustsScrollViewInsets` is deprecated in iOS 11, Now we are to use `contentInsetAdjustmentBehavior` in UIScrollView type views instead. Setting `contentInsetAdjustmentBehavior` to `.never` worked and also the 'UINavigationController translation slide up issue' wouldn't happen if the UINavigationBar is transulcent where the view is under the bar. (Thus the new way of doing the automaticallyAdjustsScrollViewInsets`)


This is not good for Storyboard users because this will have to be done in code.

Replies

I had this issue as well. The new iOS 11 is still a little bit buggy. The new and the old automatic adjustments for margins, safe areas, scroll view offsets etc. are competing against each other, or something like this.


In my case it helped to make sure that the property "edgesForExtendedLayout" of the view controllers are all back to the default value "UIRectEdgeAll".

But you should also play with the UIViewController properties "automaticallyAdjustsScrollViewInsets" and the new UIScrollView property "contentInsetAdjustmentBehavior" if you can't use the value UIRectEdgeAll.

What exactly did you do to solve this problem? It seems to be happening in all the UITableViewController type views for me.

Figured it out!


After some research ...I found that `automaticallyAdjustsScrollViewInsets` is deprecated in iOS 11, Now we are to use `contentInsetAdjustmentBehavior` in UIScrollView type views instead. Setting `contentInsetAdjustmentBehavior` to `.never` worked and also the 'UINavigationController translation slide up issue' wouldn't happen if the UINavigationBar is transulcent where the view is under the bar. (Thus the new way of doing the automaticallyAdjustsScrollViewInsets`)


This is not good for Storyboard users because this will have to be done in code.

That fixed it. Thank you!!

This is a workaround, which is great. But what happens when we want our scroll views to properly inset themselves? We have to put up with this animation?


Even as of 11.1 beta 1, this issue is still present. Seriously, Apple?

agree!

for iPhoneX, we cannot set contentInsetAdjustmentBehavior to UIScrollViewContentInsetAdjustmentNever, as we need the scrollview to adjust ui

i