I am trying to create a simple modal dialog on the iPad, in either the small (UIModalPresentationFormSheet) or the larger (UIModalPresentationPageSheet) settings, but they come out full screen (with a title bar) no matter what I do.
The modal UIViewController was created in interface builder where I can’t seem to specify a size for it. Specifying a smaller size for the UIView contained within the UIViewController has no effect.
What am I doing wrong? What would possibly affect this issue? Could it be the timing in which I am setting modalPresentationStyle? I have tried both using a UINavigationController and without, but am getting the same result.
I’ve figured this out. Turns out I was using UIModalPresentationPageSheet, which always goes to full screen in portrait mode. Because my modal UIViewController wasn’t responding to shouldAutorotateToInterfaceOrientation, it was forcing a portrait orientation, which is why I THOUGHT the modal popup wasn’t working.
By simply adding a shouldAutorotateToInterfaceOrientation handler to my modal UIViewController, that returns YES, I now see that in landscape mode I am getting a large popup that covers most (but not all) of the screen, which is what I’ve been expecting.