现在我正在使用从故事板推动一个视图控制器,只有一个推过渡。我如何模仿代码中的“流行”转换?我是否可以在现在仍然使用Storyboard进行其他转场的情况下执行此操作?更改推视图控制器动画看起来像一个“流行”动画,从左到右
UPDATE
我试了一下,建议在第一次在这里评论,有了一些变化。这里是我有什么:
UIViewController *dst = [self destinationViewController];
UIViewController *src = [self sourceViewController];
[dst viewWillAppear:YES];
[dst viewDidAppear:NO];
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGRect f = CGRectMake(-screenBounds.size.width, 0, screenBounds.size.width, screenBounds.size.height);
dst.view.frame = f;
f.origin.x = screenBounds.size.width;
src.view.frame = f;
[UIView transitionFromView:src.view
toView:dst.view
duration:0.3
options:UIViewAnimationOptionTransitionNone
completion:^(BOOL finished){
[dst viewDidAppear:YES];
UINavigationController *nav = src.navigationController;
[nav popViewControllerAnimated:NO];
[nav pushViewController:dst animated:NO];
}];
这几乎是我想要的,但原来的viewcontroller只是消失,而不是滑向右边。
评论您必须使用自定义动画,http://weeny.tk/rF2xe9C – 2013-08-17 19:04:20