iOS : ModalView with background transparent?

background, ios, modalviewcontroller, objective-c

Solution

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];

Problem

I want to show a modalview on a viewController. (which has a naviguation controller). On my view i have text, and a button to show the modalview. I created a .xib which contained my modalview (it's a view with an image and a label). When i show it, with that : ``` ShareController *controller = [[ShareController alloc] initWithNibName:@"ShareController" bundle: nil]; controller.view.backgroundColor = [UIColor clearColor]; controller.modalPresentationStyle = UIModalPresentationFormSheet; controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:controller animated:YES completion:nil]; ``` i have my modalview, BUT, the background become black.. and i want to see always the text on my view. (i tried to set alpha, etc..; but NOTHING runs :'( ) Someone to help me ? Thanks,

Original source

Related problems