iOS 上的页面卷曲
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5435547/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Page Curl on iOS
提问by eozzy
I look around for similar posts but didn't find a solution. I'm looking for a simple page turn animation (without finger tracking) like this: http://www.youtube.com/watch?v=_vOYvaNhSHw
我四处寻找类似的帖子,但没有找到解决方案。我正在寻找一个简单的翻页动画(没有手指跟踪),如下所示:http: //www.youtube.com/watch?v=_vOYvaNhSHw
Is it possible to create or license it?
是否可以创建或许可它?
Many thanks for your help.
非常感谢您的帮助。
回答by Farlei Heinen
This fragment of code do the trick:
这段代码可以解决问题:
[UIView beginAnimations:@"Flip" context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.base.view cache:YES];
[user.view removeFromSuperview];
[base.view addSubview:home.view];
[UIView commitAnimations];
In this example the "user" viewcontroller is removed, and the "home" viewcontroller is added, with a pageflip like transition
在这个例子中,“user”viewcontroller 被删除,“home”viewcontroller 被添加,具有类似 pageflip 的过渡
回答by Jhaliya
Yes, that's possible.
是的,这是可能的。
Read the following blog tutorial.
阅读以下博客教程。
http://oleb.net/blog/2010/06/app-store-safe-page-curl-animations/
http://oleb.net/blog/2010/06/app-store-safe-page-curl-animations/
http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html
http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html
http://wdnuon.blogspot.com/2010/05/implementing-ibooks-page-curling-using.html
http://wdnuon.blogspot.com/2010/05/implementing-ibooks-page-curling-using.html
回答by user513790
its old and closed question but if someone is looking for working implementation look at this XBPageCurl project
这是一个古老而封闭的问题,但如果有人正在寻找工作实施,请查看此 XBPageCurl 项目
回答by Julian Król
As I was looking for something similar I have found out that for some people (like me itself) UIPageViewControllerdid the trick with transition style UIPageViewControllerTransitionStylePageCurlideally. If you want to see what you can achieve using this component take a look at iBooks app and try to turn the page. Very simple to use, great effect.
当我在寻找类似的东西时,我发现对于某些人(比如我自己)UIPageViewController完美UIPageViewControllerTransitionStylePageCurl地使用了过渡样式。如果您想了解使用此组件可以实现什么,请查看 iBooks 应用程序并尝试翻页。使用非常简单,效果很好。
Page cant be rotated programatically and by a pan gesture which gives very page rotation/turning like feel.
页面不能以编程方式旋转,也不能通过平移手势旋转,这会产生非常页面旋转/转动的感觉。
回答by GendoIkari
Use UIViewAnimationTransitionCurlDown. Example shown in this question:
使用UIViewAnimationTransitionCurlDown. 此问题中显示的示例:

