【发布时间】:2015-05-24 15:34:34
【问题描述】:
我有一个由三层视图控制器组成的应用程序:UITabBarController => UINavigationController => UIViewController。它们都是在代码中生成的,而不是使用 IB。根据通常的设计指南,标签栏位于底部。在我的 UIViewController 中,我使用此代码来呈现 modalViewController:
myModalVC = [[MyModalViewController alloc] init];
[self.navigationController presentModalViewController:myModalVC animated:YES];
这工作正常,模态视图控制器弹出并覆盖整个屏幕。
但是,当在模态视图控制器中按下按钮时,我会运行:
[self dismissModalViewControllerAnimated:YES];
模态视图控制器动画消失。但是我可以看到原始的 UIViewcontroller 视图,但标签栏完全消失了。我用谷歌搜索了很多,但我找不到任何有同样问题的人。
【问题讨论】:
-
在 self.tabBarController 上执行 presentModalViewController 时是否观察到相同的行为?
-
根本没有显示模态视图控制器。我也尝试过 self.navigationController.tabBarController presentModalViewController 也无法显示模态 VC。
-
你可以使用 [self presentModalViewController:myModalVC animated:YES];无需通过导航控制器
标签: iphone cocoa-touch ios4