What iPhone OS APIs could I use to implement a transition animation similar to the iBook page flip transition?

China☆狼群 提交于 2019-12-18 10:46:33

问题


I'm building an iPad app that will have multiple paper pages and I'd like to implement a page transition effect that is similar to the animation you see when you turn pages in the iBooks app on the iPad. A few questions...

  1. Is that animation readily available somewhere in the UIKit API or would I have to implement it myself?
  2. If I have to implement it myself, what's a good approach or API I should look into? It definitely has a 3D feel to it, could they be using the OpenGL ES API for that?

回答1:


Apple certainly uses OpenGL ES to implement it. The actual API Apple uses is private, but this blogger has the starting of an implementation with sample code.




回答2:


If you want to implement your own solution using OpenGL ES, here's a writeup to get you started. While I'm not sure if this is the same algorithm that Apple uses, it looks pretty close. At least it won't get your app banned for using a private API.




回答3:


The problem was that the API containing the page curl library used in producing that same effect remains undocumented so it can’t be used in the app store. Fortunately Ole Begemann has created a Github project where he has provided some code which allows you to easily add a very similar effect into your own apps.

Tom Brow (http://tombrow.com/) initially created a project for an iBooks-like page turning interface called Leaves(http://github.com/brow/leaves), which was later branched(http://github.com/ole/leaves/tree/twopages) by Ole Begemann to support 2 side by side pages in landscape mode.




回答4:


Just to update the matter, Apple has released an official way (Since 5.0) to use their Animation, check UIPageViewController.



来源:https://stackoverflow.com/questions/2646714/what-iphone-os-apis-could-i-use-to-implement-a-transition-animation-similar-to-t

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