如何在后退按钮上更改弹出视图控制器动画?

har*_*alb 6 iphone animation uinavigationcontroller

我正在使用以下语句推送我的视图控制器:

[[self navigationController] pushViewController:self.customViewController animatedWithTransition:UIViewAnimationTransitionFlipFromLeft];
Run Code Online (Sandbox Code Playgroud)

现在当我按下后退按钮时,我想用uiviewanimationtransitionflipfromright来设置动画.

喜欢

[self.navigationController popViewControllerAnimatedWithTransition:UIViewAnimationTransitionFlipFromLeft];
Run Code Online (Sandbox Code Playgroud)

我怎么能这样做?

谢谢

小智 5

这有助于您在后退按钮中设置动画.

[UIView  beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelay:0.375];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)


Ada*_*dam 1

请参阅此处进行自定义背部动画:

单击导航栏中的“后退”按钮时阻止动画?