我可以在PopviewControllerralanimated上“卷曲”一个页面?
-
02-10-2019 - |
题
我可以使用此代码“ curl”视图控制器:
[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];
知道为什么不呢?我真的很想“反向”动画(好像已经剥落了贴纸以显示'Push'Ed视图控制器并在单击按钮时将其固定在上面)。
谢谢
解决方案
好的,我的旧答案是完全错误的...问题是您在设置过渡视图之前弹出视图控制器。如果将代码更改为此:
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];
它可以正常工作
其他提示
我相信您可以使用OpenGL或许多复杂的合并过程,但是要做类似的事情会很麻烦。可能会帮助您的事情: 一本简单的书转弯应用程序完全用圆合编写
不隶属于 StackOverflow