Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the exact size of UIModalPresentationFormSheet in iPad

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 ?

like image 839
Sagar Kothari Avatar asked Jun 27 '11 09:06

Sagar Kothari


2 Answers

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.

like image 75
mkral Avatar answered Oct 07 '22 05:10

mkral


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

like image 31
ugiflezet Avatar answered Oct 07 '22 05:10

ugiflezet