最近开始将我的 iOS 代码迁移到 iOS7,但遇到了一些问题。
我有一个 UINavigationController
,其中包含子视图控制器,并使用 pushViewController
来显示下一个视图。为了创建一组图像的视差动画,我对 UINavigationController
进行了自定义,使其动画化一组 UIImageViews
,而我的子视图控制器都具有 self.backgroundColor = [UIColor clearColor]
的透明度。
由于 iOS7 更新了 UINavController
动画它的子视图控制器的方式,通过部分移动当前视图控制器并在其上推送新的视图控制器,导致我的视差动画看起来很糟糕。我看到之前的视图控制器稍微移动了一下,然后消失了。有没有办法恢复以前的 UINavigationController
的 pushViewController 动画呢?我似乎在代码中找不到这个选项。
WelcomeLoginViewController* welcomeLoginViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"WelcomeLogin"];
[self.navigationController pushViewController:welcomeLoginViewController animated:YES];
甚至尝试使用:
[UIView animateWithDuration:0.75
animations:^{
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[self.navigationController pushViewController:welcomeLoginViewController animated:NO];
[UIView setAnimationTransition:<specific_animation_form> forView:self.navigationController.view cache:NO];
}];
有人知道答案吗?