iOS:横向使用iPhone默认的翻页效果
大致思路使用两层辅助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默认的翻页效果的更多相关文章
- iOS如何做出炫酷的翻页效果
详情链接http://www.jianshu.com/p/b6dc2595cc3e https://github.com/schneiderandre/popping
- jQuery支持mobile的全屏水平横向翻页效果
这是一款支持移动手机mobile设备的jQuery全屏水平横向翻页效果插件. 该翻页插件能够使页面在水平方向上左右全屏翻动,它支持手机触摸屏,支持使用鼠标滚动页面. 整个页面过渡平滑,效果很不错. 在 ...
- 动画:UIKitAnimation 简单动画学习 iOS (一) 渐变 、 移动 、翻页、来回翻转 ——转载
转载请说明(谢谢) http://blog.csdn.net/a21064346/article/details/7851695 点击打开链接 以下 一个系列的 动画效果 在 UIView.h文件中可 ...
- 利用GPU实现翻页效果
0x00 前言 有一段时间没有更新博客了,在考虑写点什么的时候正好赶上了这个月我的书<Unity 3D脚本编程>又加印了.因此写篇小文聊聊利用shader来实现翻书的效果吧. 虽然本文是这 ...
- Swift - 用CATransform3DMakeRotation实现翻页效果
Swift - 用CATransform3DMakeRotation实现翻页效果 效果 源码 https://github.com/YouXianMing/Swift-Animations // // ...
- 利用GPU实现翻页效果(分享自知乎网)
https://zhuanlan.zhihu.com/p/28836892?utm_source=qq&utm_medium=social 首发于Runtime 写文章 利用GPU实现翻页效果 ...
- 关于Page翻页效果, PageViewConrtoller
Page View Controllers你使用一个page view controller用page by page的方式来展示内容.一个page view controller管理一个self-c ...
- turn.js中文API 写一个翻页效果的参数详细解释
$('.flipbook').turn({ width: 922, height: 600, elevation: 50, gradients: true, a ...
- webapp应用--模拟电子书翻页效果
前言: 现在移动互联网发展火热,手机上网的用户越来越多,甚至大有超过pc访问的趋势.所以,用web程序做出仿原生效果的移动应用,也变得越来越流行了.这种程序也就是我们常说的单页应用程序,它也有一个英文 ...
随机推荐
- [改善Java代码]构造函数尽量简化
建议34: 构造函数尽量简化 我们知道在通过new关键字生成对象时必然会调用构造函数,构造函数的简繁情况会直接影响实例对象的创建是否繁琐.在项目开发中,我们一般都会制订构造函数尽量简单,尽可能不抛异常 ...
- sqlserver2005数据库18456错误(转)
第一步.以windows验证模式进入数据库管理器.第二步:右击sa,选择属性:在常规选项卡中,重新填写密码和确认密码(改成个好记的).把强制实施密码策略去掉.第三步:点击状态选项卡:勾选授予和启用.然 ...
- 纯CSS3制作进度条源代码
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8&qu ...
- 使用 EF Power Tool Code Frist 生成 Mysql 实体
原文:使用 EF Power Tool Code Frist 生成 Mysql 实体 1,在要生成的项目上右键 2, 3, 4, 5, 生成后的效果 已知问题: 1,在Mys ...
- Contoso 大学 - 6 – 更新关联数据
原文 Contoso 大学 - 6 – 更新关联数据 By Tom Dykstra, Tom Dykstra is a Senior Programming Writer on Microsoft's ...
- struts2文件上传(保存为BLOB格式)
html文件:提供上传文件的入口 <input type="file" name="upload"><!-- name很重要,与后面actio ...
- 洛谷 P1508 Likecloud-吃、吃、吃
P1508 Likecloud-吃.吃.吃 题目提供者JosephZheng 标签 动态规划 难度 普及/提高- 题目背景 问世间,青春期为何物? 答曰:"甲亢,甲亢,再甲亢:挨饿,挨饿,再 ...
- WaitForSingleObject用法
对应函数 编辑 VC声明 DWORD WaitForSingleObject( HANDLE hHandle, DWORD dwMilliseconds ); 参数 编辑 hHandle[in]对 ...
- uva247 - Calling Circles(传递闭包+DFS)
题意:两人相互打电话(直接或间接),则在一个电话圈.即a给b打电话,b给c打电话,则a给c间接打电话. 注意:1.注意标记.2.注意输出格式. #include<iostream> #in ...
- CLI-error
SQL_ERROR: One of the following occurred: RecNumber was negative or 0. BufferLength was less than ze ...