iPhone modal View with parent view semi-visible?

Posted by Moshe on Stack Overflow See other posts from Stack Overflow or by Moshe
Published on 2010-05-16T18:48:40Z Indexed on 2010/05/16 19:20 UTC
Read the original article Hit count: 349

I am adding a modal view using the following code:

[self presentModalViewController:phrasesEditor animated:YES];

How can I make the modal view semi-transparent so that the superview "shines" through?

My complete method/function looks like this:

-(IBAction)showEditPhrases:(id)sender{
    PhrasesViewController *phrasesEditor = [[PhrasesViewController alloc] initWithNibName:@"PhrasesViewController" bundle:nil];
    phrasesEditor.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [phrasesEditor.view setAlpha: 0.5];
    [phrasesEditor.view setBackgroundColor: [UIColor clearColor]];
    [self presentModalViewController:phrasesEditor animated:YES];
    [phrasesEditor release];
}

© Stack Overflow or respective owner

Related posts about iphone-os

Related posts about iphone-sdk-3