indragie
indragie

Reputation: 18122

Presenting modal view controller from popover

I have a view controller that is inside a popover, and I want to present a modal view controller from it. Here's my code:

EditDateViewController *dateViewController = [[EditDateViewController alloc] initWithNibName:@"EditDateViewController" bundle:[NSBundle mainBundle]];
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:dateViewController];
    navController.modalPresentationStyle = UIModalPresentationCurrentContext;
    [self presentModalViewController:navController animated:YES];
    [dateViewController release];
    [navController release];

The result is this:

alt text http://cl.ly/5300e4f8f5d440d3f850/content

For some reason, the navigation bar background is transparent (or black?) even though I did not configure it that way. I tried manually setting the tintColor property of the navigation bar in the viewDidLoad method of the modal view controller, but it had no effect.

Upvotes: 1

Views: 7402

Answers (1)

iphony
iphony

Reputation: 536

Try this

dateViewController.modalInPopover=YES;

self.navigationController.modalInPopover=YES;

Upvotes: 4

Related Questions