how to push a viewController with flip animation

浪子不回头ぞ 提交于 2019-12-13 19:07:37

问题


[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
alarmViewController = [[AlarmViewController alloc] init];
[self.navigationController pushViewController:alarmViewController animated:YES];
[alarmViewController release];
[UIView commitAnimations];

I just want the viewcontroller flip like opening a book page,but it does not work like this.And I have a question that whether navigationController can animate this effect?


回答1:


Since you are already putting the navigationController in an animation block. Mark animated:NO -

[self.navigationController pushViewController:alarmViewController animated:NO];

when we actually call pushViewController: we are setting the animated value to NO. This disables the Navigation Controller's default animation. Instead, the block of code uses the defined transition.



来源:https://stackoverflow.com/questions/7266144/how-to-push-a-viewcontroller-with-flip-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!