大致思路使用两层辅助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出了问题!!!

不知道有没有其他的好方法,如果各位有更好的方法还望赐教!

iOS:横向使用iPhone默认的翻页效果的更多相关文章

  1. iOS如何做出炫酷的翻页效果

    详情链接http://www.jianshu.com/p/b6dc2595cc3e https://github.com/schneiderandre/popping

  2. jQuery支持mobile的全屏水平横向翻页效果

    这是一款支持移动手机mobile设备的jQuery全屏水平横向翻页效果插件. 该翻页插件能够使页面在水平方向上左右全屏翻动,它支持手机触摸屏,支持使用鼠标滚动页面. 整个页面过渡平滑,效果很不错. 在 ...

  3. 动画:UIKitAnimation 简单动画学习 iOS (一) 渐变 、 移动 、翻页、来回翻转 ——转载

    转载请说明(谢谢) http://blog.csdn.net/a21064346/article/details/7851695 点击打开链接 以下 一个系列的 动画效果 在 UIView.h文件中可 ...

  4. 利用GPU实现翻页效果

    0x00 前言 有一段时间没有更新博客了,在考虑写点什么的时候正好赶上了这个月我的书<Unity 3D脚本编程>又加印了.因此写篇小文聊聊利用shader来实现翻书的效果吧. 虽然本文是这 ...

  5. Swift - 用CATransform3DMakeRotation实现翻页效果

    Swift - 用CATransform3DMakeRotation实现翻页效果 效果 源码 https://github.com/YouXianMing/Swift-Animations // // ...

  6. 利用GPU实现翻页效果(分享自知乎网)

    https://zhuanlan.zhihu.com/p/28836892?utm_source=qq&utm_medium=social 首发于Runtime 写文章 利用GPU实现翻页效果 ...

  7. 关于Page翻页效果, PageViewConrtoller

    Page View Controllers你使用一个page view controller用page by page的方式来展示内容.一个page view controller管理一个self-c ...

  8. turn.js中文API 写一个翻页效果的参数详细解释

    $('.flipbook').turn({     width: 922,     height: 600,     elevation: 50,     gradients: true,     a ...

  9. webapp应用--模拟电子书翻页效果

    前言: 现在移动互联网发展火热,手机上网的用户越来越多,甚至大有超过pc访问的趋势.所以,用web程序做出仿原生效果的移动应用,也变得越来越流行了.这种程序也就是我们常说的单页应用程序,它也有一个英文 ...

随机推荐

  1. nagios–配置文件

    ngios的配置文件位于/etc/nagios目录下 # ll /etc/nagios 总用量 -rw-rw-r-- nagios nagios 3月 : cgi.cfg -rw-r--r-- roo ...

  2. ruby 疑难点之—— yield 和 yield self

    yield 所有的"方法(methods)"隐式跟上一个"块(block)"参数. 块参数也可以明确给定,形式就是在参数前面加一个"&&quo ...

  3. Adobe Edge Animate –解决图形边缘精确检测问题-通过jquery加载svg图片

    Adobe Edge Animate –解决图形边缘精确检测问题-通过jquery加载svg图片 版权声明: 本文版权属于 北京联友天下科技发展有限公司. 转载的时候请注明版权和原文地址. 在edge ...

  4. XShell提示Connection closed by foreign host的问题 和 路由器分配IP的规则

    情况是这样的: VMware中有三个Linux机器分别是crxy99(192.168.1.99),crxy100(192.168.1.100),crxy101(192.168.1.101),crxy1 ...

  5. [改善Java代码]不要让类型默默转换

    建议23:不要让类型默默转换 public class Client { // 光速是30万公里/秒,常量 public static final int LIGHT_SPEED = 30 * 100 ...

  6. 关于Hadoop之父Doug Cutting

    生活中,可能所有人都间接用过他的作品,他是Lucene.Nutch .Hadoop等项目的发起人.是他,把高深莫测的搜索技术形成产品,贡献给普罗大众:还是他,打造了目前在云计算和大数据领域里如日中天的 ...

  7. Hashtable 和 HashMap 的比较

        Hashtable HashMap 并发操作 使用同步机制, 实际应用程序中,仅仅是Hashtable本身的同步并不能保证程序在并发操作下的正确性,需要高层次的并发保护. 下面的代码试图在ke ...

  8. asp.net的CascadingDropDown取值和赋值

    获取选择的值 可以使用形如以下的方式获得选择的值: Label1.Text = ddlProvince.SelectedValue;        Label2.Text=ddlCity.Select ...

  9. Linux 内核模块设计

    一.  内核模块 1.  头文件 Linux/init.h  和 Linux/module.h 2.  装载内核 insmod  对应的转载函数 module_init(); 3.  卸载内核 rmm ...

  10. jquery点击控制动画暂停开始

    一下是从w3c上面考下来了的, animation:[[ animation-name ] || [ animation-duration ] || [ animation-timing-functi ...