2

我可以使用以下代码“卷起”视图控制器:

[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];

知道为什么不?我只是真的想“反转”动画(好像贴纸已被剥离以显示“推送”视图控制器并在他们单击按钮时重新打开)。

谢谢

4

2 回答 2

4

好的,我的旧答案完全错误......问题是您在设置转换视图之前弹出视图控制器。如果您将代码更改为:

[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO]; 
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];

它工作正常

于 2010-09-13T12:32:21.757 回答
1

使用 OpenGL 或许多复杂的 CoreAnimation 进程,我相信你可以,但是,这样做会很麻烦。可能对您有所帮助的东西:一个完全用 CoreAnimation 编写的简单的翻书应用程序

于 2010-09-13T11:20:10.510 回答