iOS翻页(PageCurl)效果总结

到目前最新的sdk(4.3),apple没有提供pageCurl的API, 要实现google map app那样的翻页效果只能靠自己实现。

总结一下我收集到的资源。

用私有api实现的iBook翻页效果:http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html 

用openglES实现的一个翻页效果:http://wdnuon.blogspot.com/2010/05/implementing-ibooks-page-curling-using.html 在此基础上可以发展自己的pageCurl.

用CoreAnimation实现的翻页效果,完全2D的一个模拟效果:http://github.com/brow/leaves 后来的增强版 http://github.com/ole/leaves

第一种私有api的不能上appstore,但效果最佳, 第二种很不错,但不能像第一种一样随着手指的移动而变形。第三种效果不错,但不像是在翻页。

所以我推荐第二种方法,如果我们把那个虚拟的圆锥也随手指的移动而变化方位,是不是效果与第一种有就有像了呀?我没有深入研究了,有时间精力的人去研究研究。


苹果为何不公布这种api出来呀? 也不会存在什么安全因素吧。想不通!!!


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
The "Unity3D Book Page Curl" is a unity package that is used to create a book with page flip effect using unity3D native UI tools. Getting Started Create your first book:  Import the unity package  Create a canvas and EventSystem objects if you don't have one (the easiest way to create them is by adding any UI object -like a button- then you can delete it).  Drag a book prefab under the Canvas element  Resize the book on your scene and reposition the anchors as required.  Select the book from hierarchy to show it in inspector.  Assign the canvas to the canvas slot in inspector  Assign the background sprite with the sprite that you want to show on the right or left side when all pages flipped to the other side.  To edit the book pages, expand the Book Pages list in inspector, change the Size to your pages count, then start drag your pages in the Element boxes in order  Set the current page to the page that you want to be shown initially in the right side of the book.  If you want to call any function when any page flipped add it to the OnFlip Event List.  If you want to resize the area that the user can drag the page from it, open the Book node in inspector to show its children, you will find two objects "RightHotSpot" and "LeftHotSpot" resize them and set their anchors as required.  RUN and enjoy the page curl effect! Create Automatic Flipping Book:  After creating your book as mentioned above add an "Auto Flip" component on it.  Choose flipping direction( if you choose left to right make sure that the current page of the book component is equal to your page count "last page index + 1").  Uncheck the interactable check in the book component.  Specify the page flipping time parameters (Page Flip Time, Time Between Pages, Delay before Start flipping, Number of Animation frames for each page flip).  Check "Auto Start Flip" if you want the book to start flipping automatically, or uncheck it and call the StartFlipping() function in your code. Control Flipping Manually: This section will explore how to create a scene like the “Example_2_Controled Flipping” scene  To be able to let the user control page flipping using some buttons, create your book, add an "Auto Flip" component on it and configured them as mentioned above.  Uncheck the “interactable” of the book and "Auto Start Flip" of the “Auto Flip” components.  Add previous and next buttons to your scene (check Example_2_Controled Flipping scene if you have any issues setting them correctly).  Add a new slot on each button OnClick list by clicking the (+) sign, assign the Book as the game object then select the “AutoFlip->FlipRightPage” for the next button and “Auto Flip->Flip Left Page” to the previous button.  If you need to flip the page from code (based on custom action) you can call the FlipLeftPage() or FlipRightPage().
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值