【发布时间】:2024-01-12 17:51:01
【问题描述】:
在我的应用程序中,我有一个 UITabBarController,其中有 4 个标签,每个标签中都有 UINavigationController。当用户从表中选择某些内容时,我从UINavigationController 之一的根 VC 推送一个新的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
我已经检查以确保详细视图没有被多次推送,但我不知道是什么原因造成的。
【问题讨论】:
-
你试过用
pushViewController代替presentViewController吗?出现问题了吗? -
Umang Bista,我刚刚尝试过,确实有效,但是我需要以模态方式呈现此视图,以便标签和导航栏不再可见。
-
您使用的是哪个版本的 iOS?模拟器还是设备? Found this link 和 this from RayWenderlich
-
你是在没有先关闭模态视图控制器的情况下弹出视图控制器吗?
-
rdelmar 不,每个步骤都由用户触发。首先关闭模态视图,然后按详细视图上的后退按钮。
标签: ios uinavigationcontroller modalviewcontroller pushviewcontroller