大致思路使用两层辅助UIView的旋转来实现添加后的View的横向翻页效果
CATransform3D transformA = CATransform3DRotate(CATransform3DIdentity, degreesToRadian(90), 0, 0, 1.0f);
CATransform3D transformB = CATransform3DRotate(CATransform3DIdentity, degreesToRadian(180), 0.0f, 1.0f, 0.0f);
bgview.layer.transform = CATransform3DConcat(transformA, transformB);
CATransform3D transform3DA = CATransform3DRotate(CATransform3DIdentity, degreesToRadian(90), 0, 0, 1.0f);
CATransform3D transform3DB = CATransform3DRotate(CATransform3DIdentity, degreesToRadian(180), 0.0f, 1.0f, 0.0f);
superView.layer.transform = CATransform3DConcat(transform3DA, transform3DB);
View的层次:superView──bgView──自己的View
向bgView中添加自己的View(注:要在bgView的subViews多于一个时才有翻页效果)
[UIView beginAnimations:@"view transition" context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:bgView cache:NO];
[bgView addSubview:viewController.view];
这样做一是实现了横向翻页,二是保证你自己的View添加之后的方向是正确的,试试就知道为什么非要弄两层来辅助了,至于旋转后的Frame变化问题就看自己的使用情况调整了,尤其注意顶层View(添加进去的View)的Touch事件可能无法识别到,是因为底层View(bg和super View)旋转后的Frame出了问题!!!
不知道有没有其他的好方法,如果各位有更好的方法还望赐教!
相关推荐
Many applications on iPhone use machine learning: Siri to serve voice-based requests, the Photos app for facial recognition, and Facebook to suggest which people that might be in a photo. You'll ...
这是一个ios的新浪微博iphone版的客户端,代码成功运行还需要一个appkey,请大家到新浪微博开发平台申请一个appkey,然后加入到程序文件中名为Url.h的文件中,找到一个apply_url,将里面的“AppKey”替换成你所申请...
wpf仿iphone桌面翻页效果,不满足翻页条件则回滚当页,另外增加了左右翻页按钮。
iOS tableview 横向分页刷新 ego实现
iOS 10 SDK Development: Creating iPhone and iPad Apps with Swift by Chris Adamson English | 24 Mar. 2017 | ASIN: B071RRCK9R | 264 Pages | AZW3 | 5.24 MB All in on Swift! iOS 10 and Xcode 8 make it ...
iOS 常见的翻页效果
使用iOS官方提供的UIPageViewController实现翻页效果
iOS的一个UIPageViewController程序示例,实现翻页效果。 原文:http://www.techotopia.com/index.php/An_Example_iOS_5_iPhone_UIPageViewController_Application 做了两遍,终于成功了!欢迎交流!
Axure原型图:iOS12元件库iPhoneX高保真UI移动端RP原型图 ios12YuanJianKu_s8 字体文件 Mac字体安装.png windows字体安装.png fontawesome-webfont.ttf IOS12 Library And App Template 交互原型模板.rp iPhoneX And...
iOS的翻页效果 翻页放大缩小效果 可以自己设置想要效果
本演讲将结合讲师这些年自学iPhone开发的历程,结合自己多个应用开发实践的案例,与大家分享iOS开发的技术实践,内容将涉及:开源框架的选择,如何搭建程序架构从而写更干净的代码,如何有效使用内存和防止内存泄露...
Get a solid grounding in all the fundamentals of Cocoa Touch, and avoid problems during iPhone and iPad app development. With Programming iOS 4, you'll dig into Cocoa and learn how to work effectively...
IOS应用源码——3D书本翻页效果.zip
IOS应用源码之3D书本翻页效果.rar
iOS网络高级编程 iPhone和iPad的企业应用开发 [(美)考克斯PDF电子书下载 带书签目录 高清完整版
GNS3模拟器IOS:c3745-ik9s-mz.123-13a
iOS网络高级编程 iPhone和iPad的企业应用开发--高清版.pdf 个人收集电子书,仅用学习使用,不可用于商业用途,如有版权问题,请联系删除!
ios应用源码之应用程序翻页特效(类似苹果电子书的翻页效果)
GNS3模拟器IOS:c3640-jk9o3s-mz.124-10a 功能满完善的一个~ 【强力推荐】