6

I have a viewController (mainView) that supports every orientation on iPhone. From this view, another viewController is presented with modal style, which only supports only Portrait orientation (and forces the orientation accordingly).

Usually, the topLayoutGuide is at y=20px and the layout of the toolbar right below is attached to that topLayoutGuide Now i have the following sequence of events

  • display mainView in portrait orientation
  • open modal view in portrait orientation
  • turn to landscape orientation (modal view obviously stays in portrait orientation)
  • dismiss modal view and return to mainView

After this, the topLayoutGuide is suddenly at y=0px and therefore, the toolbar is positioned over the statusbar, and also keeps that value after rotation in the mainView.

Does anyone know how to update (or force) the topLayoutGuide back to 20px?

MeXx
  • 3,230
  • 22
  • 36

1 Answers1

0

You can either adjust insets manually, or you can force the SDK to force to "refresh the orientation" of your controller.

Community
  • 1
  • 1
Rivera
  • 10,182
  • 3
  • 49
  • 96