7

I am using following code for displaying a Screen/View Controller.

SearchParams *nxt=[[SearchParams alloc] initWithNibName:@"SearchParams" bundle:nil];

UINavigationController *nvc=[[UINavigationController alloc] initWithRootViewController:nxt];

nvc.modalPresentationStyle=UIModalPresentationFormSheet;

[self.preLCtr.preCinescape_iPadViewController presentModalViewController:nvc animated:YES];

I am not sure about the size of PesentationSheet. I tried to take screenshots & take dimentions/size. But its not the exact solution.

Question : What is the exact size of Present-Modal-Sheet in iPad ?

sagarkothari
  • 24,520
  • 50
  • 165
  • 235
  • According to the screen-shot taken, it is 545 × 625 pixels. Is it the correct one ? – sagarkothari Jun 27 '11 at 09:34
  • http://stackoverflow.com/questions/30491951/what-exactly-is-the-height-of-modalpresentationstyle-formsheet-on-ipad You can find it here. – Neela Mar 30 '17 at 19:56

4 Answers4

23

This is what I found for the current (iPad 3) iO6 dimensions:

BOUNDS: 540.000000, 620.000000 - Portrait-no-keyboard.

But you shouldn't use this for any code. Follow the correct answer.

mkral
  • 4,065
  • 4
  • 28
  • 53
  • It does seem bad to do this, but I wanted to recreate the form sheet size with a custom presentation controller and... it does seem to be a fixed 540x620. I tested a few different iPads and orientations and it never changes. – Max Sep 10 '18 at 19:26
16

According to Apple's documentation the size could change depending on the available screen size:

The width and height of the presented view are smaller than those of the screen and the view is centered on the screen. If the device is in a landscape orientation and the keyboard is visible, the position of the view is adjusted upward so that the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.

Maybe in the viewcontroller that is loaded to the FormSheet you can determine the view size at runtime by using: self.view.bounds;

If you need to resize the FormSheet i saw some answers on stackoverflow

Community
  • 1
  • 1
ugiflezet
  • 451
  • 9
  • 17
12

If you're adjusting a freeform view controller so that you can get the aspect right for a modal transition with form sheet presentation style, note that there is a Form Sheet option under the Size dropdown in the Size Inspector. I didn't notice this at first.

enter image description here

Kyle Clegg
  • 38,547
  • 26
  • 130
  • 141
3

I checked different orientation and also in multi window mode, the default size is

width: 540, height: 620.

And below is the screenshot from Reveal.

enter image description here

Phillip
  • 801
  • 10
  • 13