我可以使用以下代码“卷起”视图控制器:
[UIView beginAnimations:@"animation" context:nil];
[self.navigationController pushViewController:page animated:NO];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
但我不能像这样卷曲最后一页:
[UIView beginAnimations:@"animation" context:nil];
[self.navigationController popViewControllerAnimated:NO];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
任何想法为什么不呢?我只是想“反转”动画(好像贴纸已被剥离以显示'推送视图控制器并在点击按钮时卡住)。
由于
答案 0 :(得分:4)
好的,我的老答案完全错了...... 问题是您在设置转换视图之前弹出视图控制器。如果您将代码更改为:
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];
一切正常
答案 1 :(得分:1)
使用OpenGL或许多复杂的CoreAnimation流程,我相信你可以,但是,做这样的事情会有很多麻烦。可能有助于您的事情:A simple book turning application written entirely with CoreAnimation