iOS7 Content Offset by 20 pixels for non existent Status Bars

Mike M picture Mike M · Sep 12, 2013 · Viewed 7.7k times · Source

I have a strange behaviour with my UIViews as I'm migrating to iOS7. It seems that they are sent a message to shrink by 20 pixels. I have removed the status bar from all my XIB files and explicitly set it to hidden in the application delegate. My UINavigationController seem to be sent a message:

_computeAndApplyScrollContentInsetDeltaForViewController

which in turn sends messages to my scroll views

_adjustContentOffsetIfNecessary

which set their offset to -20 pixels... This should not really happen as there is no reason for that function to adjust anything by that amount.

Does anyone have an idea of how to fix this?

Answer

Mike M picture Mike M · Sep 13, 2013

I found the solution! Just set:

self.automaticallyAdjustsScrollViewInsets = NO;

on the view controller that has the scroll view as a view...