从弹出窗口呈现模态视图控制器

发布于 2024-09-14 12:34:00 字数 807 浏览 9 评论 0原文

我有一个位于弹出窗口内的视图控制器,我想从中呈现一个模式视图控制器。这是我的代码:

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

结果是这样的:

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

由于某种原因,导航栏背景是透明的(或黑色?),即使我没有这样配置。我尝试在模态视图控制器的viewDidLoad方法中手动设置导航栏的tintColor属性,但没有效果。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱&纷飞 2024-09-21 12:34:01

试试这个

dateViewController.modalInPopover=YES;

self.navigationController.modalInPopover=YES;

Try this

dateViewController.modalInPopover=YES;

self.navigationController.modalInPopover=YES;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文