Search code examples
iphoneiospresentmodalviewcontrolleruimodalpresentationstyle

PresentModalViewController with some frame


I want to present a modalViewController with a small frame and at the center of the view.

Is that possible?

Even if I set some frame to the viewController object, presentModelViewController is displaying that view in full screen mode.

Also, I have used modalPresentationStyle as UIModalPresentationFormSheet. I want to have frame even smaller than that.

How to do that?


Solution

  • You cannot present a modal view controller that has a smaller frame size.

    what you can try doing is to set the background of your modal view controller to transparent and then add the smaller sized view in the center (or where ever you wish to have it seen).