3
votes

In my iPad storyboard, I have a + button in my nav bar which should bring up a new view controller in a Modal Form Sheet (image 1). However, the View Controller ends up filling the ENTIRE screen at first (image 2). If I tap one of the UITextfields in the new view controller, then when the keyboard comes into view the view controller finally resizes down to the Form Sheet and displays correctly (image 3).

It only happens when in Portrait orientation. In landscape, everything works fine.

How do I fix this?

enter image description here

Here is my segue configuration:

enter image description here

This is NOT a duplicate of iPad modal form sheet takes up the whole screen anyways, because his problem is while presenting via code and was able to change his code to fix the problem. I've got a Storyboard segue attached to a UIBarButtonItem and so I only have control via the Storyboard.

1
Make sure you've added your constraints and created the view controller that will be presented modally in Any/Any.AMayes
This happens to me in landscape (my app doesn't support portrait). I just created the storyboard that the segue links to.Rick

1 Answers

0
votes

I have no idea why this seems to work... but my problems went away when I embedded my view controller in a UINavigationController with the nav bar visible. (At first, I had the nav bar hidden and it was still broken. When I made the nav bar visible, then it was correctly sized in both orientations.)