【发布时间】:2014-10-02 20:53:21
【问题描述】:
我有 6 个 UIViewControllers 与带有标识符的推送 segues 连接,并在我的应用程序中使用此方法“跳转”到所需的 UIViewController 以堆叠 ViewControllers:
- (void) JumpTo6 {
UINavigationController *nav = self.navigationController;
UIViewController *a =[self.storyboard instantiateViewControllerWithIdentifier:@"2"];
[nav pushViewController:a animated:NO];
UIViewController *b =[self.storyboard instantiateViewControllerWithIdentifier:@"3"];
[nav pushViewController:b animated:NO];
UIViewController *c =[self.storyboard instantiateViewControllerWithIdentifier:@"4"];
[nav pushViewController:c animated:NO];
UIViewController *d =[self.storyboard instantiateViewControllerWithIdentifier:@"5"];
[nav pushViewController:d animated:NO];
UIViewController *e =[self.storyboard instantiateViewControllerWithIdentifier:@"6"];
[nav pushViewController:e animated:YES];
使用 iOS7 时一切正常。我会触发这个方法,假设我在UIViewController 1 上,系统将每隔UIViewController 堆叠一次,直到 UI VC 6,UIViewController 6 会呈现动画。
但是在 iOS8 上出现了奇怪的行为。系统短暂显示UIViewcontroller 5,然后转到UIViewcontroller 6。这是我不想要的。
总结一下:
iOS 7:1 -----> 6 - 可取
iOS 8:1 -----> 5(在短时间内)----> 6 - 不受欢迎
我的问题是如何使用 iOS 8 达到理想的效果。Ty!
【问题讨论】:
-
为什么要这样做?这不是使用导航控制器的正常方式。如果用户在这种情况下点击后退按钮(从 6 开始),他将返回到 5,这是他以前从未见过的 - 他会期待返回到 1,因为他来自那里。
-
这正是我想要的。
-
好吧,希望 Apple 可以接受。我不知道这是否违反了HIG。
标签: objective-c uiviewcontroller uinavigationcontroller ios8 xcode6