Present a Modal View Controller with Transparent Background

Transparent ViewController to See Parent Below?

@Josh Kahane
set the view controller that will present the transparent view controller with this code at the -ViewDidLoad
and be sure to set the alpha channel of the UIViewController View to be lower then 1.

Code:

self.modalPresentationStyle = UIModalPresentationCurrentContext;

iOS : ModalView with background transparent?

you can check the iOS7 example (see my comm) or you can simple try this:

remove this line from your "presenting" method

controller.view.backgroundColor = [UIColor clearColor];

now, in viewDidLoad of the ShareController add:

 self.view.backgroundColor = [UIColor clearColor];
self.modalPresentationStyle = UIModalPresentationCurrentContext;
self.modalPresentationStyle = UIModalPresentationFormSheet;

PS

if you have a navigationController... use

[self.navigationController presentViewController:controller animated:YES completion:nil];


Related Topics



Leave a reply



Submit