Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad modal form sheet takes up the whole screen anyways

I'm trying to create a form sheet modal on iPad, which should be a 540x620 modal view.

I've created a view controller with a NIB file whose view is a 540x620 sized UIView (with stuff on it).

I set the modal presentation style to UIModalPresentationFormSheet, and call presentModalViewController:animated: on the current view controller.

My view slides in from the bottom, but instead of being a form sheet, it takes up the whole screen (my view elements are all anchored in the top left of the screen).

Even stranger, when I dismiss it, all the UI that was "underneath" it, is all re-layed out to be in the center, in approximately a form sheet sized area in the center of the screen. Bizarro!

Anyone have any suggestions as to what could cause this behavior?

Thanks.

like image 945
Ben Zotto Avatar asked May 14 '10 23:05

Ben Zotto


1 Answers

Figured this out. I was setting the modal presentation style on the parent view controller-- it needs to be set on the newly-created child controller. One needs to think of it as a property of the child, not something the parent controls.

I would delete this question, but figure I'll leave it as a signpost for the future wayward.

like image 95
Ben Zotto Avatar answered Nov 08 '22 08:11

Ben Zotto