【问题标题】:Transition between two UIViewControllers with no animation没有动画的两个 UIViewController 之间的转换
【发布时间】:2012-05-19 13:01:00
【问题描述】:

从我的 appDelegate 我像这样加载 homeScreen ViewController:

UIStoryboard* sb = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *controller = [sb instantiateViewControllerWithIdentifier:@"HomeScreen"];
[self.window setRootViewController:controller];

应用程序只有在我的“homeScreen”和“PlayViewController”ViewControllers 之间发生变化,并且是这样完成的:

 PlayViewControlller* vc = [self.storyboard instantiateViewControllerWithIdentifier:@"PlayViewController"];
[self presentModalViewController:vc animated:NO];

还有这个

UIStoryboard* sb = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *controller = [sb instantiateViewControllerWithIdentifier:@"HomeScreen"];
[self presentModalViewController:controller animated:NO];

分别。

这一切都很好。我可以在带有 uibuttons 的视图控制器和上面的代码之间切换。但是,我不确定是什么原因造成的,它发生在我在两个视图控制器之间切换了几次之后,但是过渡开始变得动画并且在切换时它们开始旋转。

好的,我正在尝试缩小问题范围,看看是什么原因造成的。我认为它是我在我的应用程序中使用的其他动画块。但是那里有很多所以不知道到底是什么。

【问题讨论】:

    标签: ios uiviewcontroller


    【解决方案1】:

    好的,如果有人碰巧遇到同样的情况,我找到了导致这种情况的代码行。

       [UIView beginAnimations:@"Move" context:NULL];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      • 2013-07-08
      相关资源
      最近更新 更多