iOS UINavigationBar在呈现UIViewController后会损坏
问题描述:
在我的应用程序中,我有一个UITabBarController
,其中包含UINavigationController
的4个选项卡。从UINavigationController
之一的根VC中,当用户从表中选择一些内容时,我推送一个新的UIViewController
。从这个细节观看模式的看法,可以提出这样的:iOS UINavigationBar在呈现UIViewController后会损坏
PlayerViewController *playerViewController = [[PlayerViewController alloc] initWithNibName:@"PlayerViewController" bundle:nil];
playerViewController.videoURL = videoURL;
[self presentViewController:playerViewController animated:YES completion:nil];
如果模式的看法是不提供的应用程序的功能就好了,但如果我提出从推IUViewController
那么该模式的看法时IUViewController
被弹出在UINavigationBar
损坏,下一次视图推我得到这个:
nested push animation can result in corrupted UINavigationBar
我检查,以确保细节视图没有被推多次,我想不出什么原因这个。
答
尝试呈现视图控制器
前设置
playerViewController.modalPresentationStyle = .CurrentContext
您是否尝试过使用'pushViewController',而不是'presentViewController'?问题是否发生? – 2015-03-19 04:33:41Umang Bista,我刚刚尝试过,但确实有效,但我需要以模态方式呈现此视图,以便标签和导航栏不再可见。 – harryisaac 2015-03-19 04:37:10
您正在使用哪个版本的iOS?模拟器还是设备? [找到这个链接](https://github.com/TeehanLax/UIViewController-Transitions-Example/issues/5)和[来自RayWenderlich](http://www.raywenderlich.com/forums/viewtopic.php?f = 2&t = 9783) – 2015-03-19 04:44:46