开发者

Presenting modal view controller from popover

开发者 https://www.devze.com 2023-01-11 19:57 出处:网络
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:

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 tin开发者_如何转开发tColor property of the navigation bar in the viewDidLoad method of the modal view controller, but it had no effect.


Try this

dateViewController.modalInPopover=YES;

self.navigationController.modalInPopover=YES;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号