Modal irregular shape on iPad

Is it possible to display a modal view with an irregular shape using presentModalViewController ? The modal partially covers the screen (presentation style is set to UIModalPresentationFormSheet )

I tried just setting the clipsToBounds supervisor to NO, this did not work. I also can not get rid of the rounded corner.

PS: I try to avoid creating a custom view and do it manually.

PPS: I noticed from the docs that we should use presentViewController now in iOS 5. However, it did nothing else.

+4
source share
2 answers

I kind of worked. It's a little hack, but it works.

Code (this is inside the controller that spawns the modal):

 // Present the modal [self presentViewController:modalVC animated:YES completion:NULL]; // Let content overflow and shrink superview to a small dimension modalVC.view.clipsToBounds = NO; modalVC.view.superview.bounds = CGRectMake(modalVC.view.superview.bounds.origin.x, modalVC.view.superview.bounds.origin.y, 100, 100); 

Now just make modal views bigger than the supervisor, and you can go crazy with the form.

Please note that touches will only be recorded in the supervisor area.

+4
source

No, you can’t, you must stick to the styles that Apple provides you with, http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html

As you say, you need to create your own look and animate it.

0
source

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


All Articles