What is the exact size of the UIModalPresentationFormSheet in iPad

I am using the following code to display a screen controller / view.

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 the PesentationSheet. I tried to take screenshots and take dimensions / size. But this is not an exact solution.

Question: What is the exact size of the current modal sheet in the iPad?

+6
source share
4 answers

According to the Apple documentation, the size may vary depending on the available screen size:

The width and height of the presented view is less than the width of the screen, and the point of view is focused on the screen. If the device is in landscape orientation and the keyboard is visible, the view position is adjusted upward so that the view remains visible. All unclosed areas are darkened so that the user cannot interact with them.

Perhaps in the view manager, which is loaded into FormSheet, you can determine the size of the view at runtime using: self.view.bounds;

If you need to resize FormSheet, I saw several answers at fooobar.com/questions/123277 / ...

+12
source

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

BOUNDS: 540.000000, 620.000000 - Portrait-without a keyboard.

But you should not use this for any code. Follow the correct answer.

+22
source

If you are setting up a free-form view controller so that you can get the aspect right for a modal transition using a sheet-style presentation style, note that there is a Form Sheet option in the Size drop-down list in the Size Inspector. I have not noticed this before.

enter image description here

+11
source

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

width: 540, height: 620 .

And below is a screenshot from Reveal.

enter image description here

+1
source

Source: https://habr.com/ru/post/891433/


All Articles