我在控制器之间进行自定义转换时遇到问题。我有两个视图控制器。首先是表视图控制器,启动控制器是第二个。它的左上角有一个按钮,当按下它时,会调用第一个导航控制器。应该有幻灯片动画,但是从左到右,而不是从右到左。我做了自己的过渡,但是当按下按钮时,过渡看起来非常糟糕。转换代码:
CATransition *transition = [CATransition animation];
transition.duration = 0.45;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
transition.type = kCATransitionFromLeft;
[transition setType:kCATransitionPush];
transition.subtype = kCATransitionFromLeft;
transition.delegate = self;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:controller animated:NO];
这是截图,过渡如何: