How to change modalPresentationStyle when modal presentation controller is already shown?

I want my modal style of the UIModalPresentationFormSheet style to UIModalPresentationFormSheet become the UIModalPresentationFormSheet style, but when it has already been shown with the UIModalPresentationFormSheet type, it cannot go into full-screen mode using the code " [xx setModalPresentationStyle:UIModalPresentationFullScreen];

Is there any way to change the real style after showing the modal look? My code is:

 UITableDownload* vc = [[UITableDownload alloc] initWithStyle:UITableViewStylePlain]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; [nav setModalPresentationStyle:UIModalPresentationFormSheet]; [MainAppDelegate mainBrowserViewController] presentModalViewController:nav animated:YES]; ...//after shown,sometime I implement following code: [nav setModalPresentationStyle:UIModalPresentationFullScreen];//(The "nav" object is the same as above code) //But the change style code takes no effect. 
+6
source share
3 answers

Not sure if this is the answer or not, but have you tried to access the controller through modalViewController?

Sort of:

 [self.modalViewController setModalPresentationStyle:UIModalPresentationFullScreen]; 

but not:

 [nav setModalPresentationStyle:UIModalPresentationFullScreen]; 
0
source

I think you can try modifying modalpresentationStyle as UIModalPresentationPageSheet

 [nav setModalPresentationStyle:UIModalPresentationPageSheet]; 

This type should autorotate your modal look.

0
source

This is still a question for me in the iOS 7 application, and at this point I can only conclude that changing the modal PresentationStyle after the transition has occurred simply has no effect.

0
source

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


All Articles