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程序做出仿原生效果的移动应用,也变得越来越流行了.这种程序也就是我们常说的单页应用程序,它也有一个英文 ...
随机推荐
- Android 自学之选项卡TabHost
选项卡(TabHost)是一种非常实用的组件,TabHost可以很方便地在窗口上放置多个标签页,每个标签页相当于获得了一个与外部容器相同大小的组建摆放区域.通过这种方式,就可以在一个容器中放置更多组件 ...
- poisspdf(so also poisscdf, poissfit, poissinv, poissrnd, poisstat, pdf.)
Poisson分布的累积概率值 命令:poisscdf 格式:poisscdf (k, Lambda) Poisson分布 在二项分布中,当n的值很大,p的值很小,而np又较适中时,用Poisson分 ...
- hdu 4571 floyd+动态规划
思路: 我们先求一遍floyd,将各点的最短距离求出,然后将点按si的升序排序.dp[i][k]表示第i个点在第j时间所获得的最大效益,那么 dp[i][k]=max(dp[ i ][ k ] , ...
- asp.net下的b/s架构
最近一直在做asp.net下的b/s架构的程序.整理一下可以采用的架构. 简单三层架构 基于接口和工厂模式的三层 前台用jquery调用http请求(ashx),ashx再调用逻辑接口 虽然很早就知道 ...
- 开始学习css
今天开始学习css:应用一本<HTML5与CSS3网页设计基础> 先学习css样式规则声明. Body{ color:blue} 对应:选择符:{声明属性:声明值}: Background ...
- 基本STRUTS标签-学习笔记-Bean标签
<bean:include> 和标准的JSP标签<jsp:include>很相似,都可以用来包含其他Web资源的内容,区别在于<bean:include>标签把其它 ...
- Nhibernate3.3.3sp1基础搭建测试
实体类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syst ...
- Android 如何监听返回键,弹出一个退出对话框
android 如何监听返回键点击事件,并创建一个退出对话框, 防止自己写的应用程序不小心点击退出键而直接退出.自己记录下这个简单的demo,备用. public class BackKeyTest ...
- iPad accessory communication through UART
We manufacture a new accessory for iPad/iPhone which should transfer commands to the iPad. We like t ...
- jquery学习--选择器
选择器:basic $('button') html 标签 $('#test') 标签ID $('.test') 标签的class $('.test,#test,h1') 多选用逗号隔开 $('*') ...