iPhone - 如何将卷页效果添加到自定义视图?
我看过一些库(例如 https://github.com/brow/leaves )在iOS上实现卷页效果。
但这些仅限于 pdf、图像或 coregraphics 绘图。我想要实现的是将页面替换为自定义视图(例如包含几个按钮、imageview、UITableView 等的视图)。
现在我的问题是我们如何为一组不同的自定义视图(来自不同的视图控制器)提供页面卷曲效果?
I have seen a few libraries ( e.g https://github.com/brow/leaves ) on how to implement page curl effect on iOS .
But these are limited to a pdf , image or coregraphics drawing . What I want to implement is a page shoule be replaced by a custom view ( like a view containing a couple of buttons , an imageview , a UITableView etc ) .
Now my question is how do we have page curl effects for a set of different custom views ( from different view controllers ) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看一下
UIView
中的transitionFromView
和transitionWithView
方法:options
参数可以设置为UIViewAnimationOptionTransitionCurlUp
/UIViewAnimationOptionTransitionCurlDown
。Take a look at the
transitionFromView
andtransitionWithView
methods inUIView
:The
options
parameter can be set toUIViewAnimationOptionTransitionCurlUp
/UIViewAnimationOptionTransitionCurlDown
.不确定您想要实现什么?它是一种模态对话框,控件位于卷曲的角落后面(如地图应用程序中)或完整的书籍样式页面卷曲(如 iBooks 中)?
第一次看 Steve Job 的答案(从来没想过我会这么说),后者可以使用
UIPageViewController
完成(查看 此处 从 UIPageViewController 开始)。Not sure what you want to achieve? Is it kind of modal dialog with controls behind a curled-up corner like in maps app or a full book style page curl like in iBooks?
For the first look at Steve Job's answer (never thought I'd say this), the latter can be done with
UIPageViewController
(look here to start with UIPageViewController).