The modal UIViewController always goes full screen on the iPad. WHAT FOR?

I'm trying to create a simple modal dialog on an iPad, either in small (UIModalPresentationFormSheet) or large (UIModalPresentationPageSheet) settings, but they go full screen (with a title) no matter what I do.

The modal UIViewController was created in an interface constructor, where I cannot specify a size for it. Specifying a smaller size for the UIView contained in the UIViewController has no effect.

What am I doing wrong? What could affect this issue? Could there be a time at which I set modalPresentationStyle? I tried using the UINavigationController without it, but I get the same result.

+3
source share
2 answers

. , UIModalPresentationPageSheet, . UIViewController shouldAutorotateToInterfaceOrientation, , , .

toAutorotateToInterfaceOrientation UIViewController, YES, , am , ( ) , .

+3

modalPresentationStyle ViewController presentModalViewController:animated.

myViewController = // create your new controller if needed 
myViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
// "self" is the parent ViewController
[self presentModalViewController:myViewController animated:YES]
+5

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


All Articles