0

I have a View Controller with one main image covering the whole of the view, and a few buttons. When I get to this view through a push segue from the previous controller, the view is shifted downwards below the status bar, showing a black strip where the view is missing (and moving my buttons out of position).

WRONG

When I show the next screen and dismiss it, the view shifts back to the correct position.

CORRECT

How can I make sure that the correct distribution of the view (second image) happens every time?

UPDATE:

This is how my storyboard looks:

enter image description here

Jacobo Koenig
  • 11,728
  • 9
  • 40
  • 75

1 Answers1

1

I was able to fix this problem with a simple line of code:

self.automaticallyAdjustsScrollViewInsets = false

By the way, this was happening to me on a UIPageViewController and this line of code was included in ViewDidLoad of that VC, not the Content View Controller.

Jacobo Koenig
  • 11,728
  • 9
  • 40
  • 75