iOS 页面之间的专长动画控制器间的转换
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 24.0px; font: 14.0px "Heiti SC Light"; color: #323333; background-color: #f3feec }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 24.0px; font: 14.0px Arial; color: #323333; background-color: #f3feec; min-height: 16.0px }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 24.0px; font: 14.0px "PingFang SC"; color: #323333; background-color: #f3feec }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff }
p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff; min-height: 13.0px }
p.p6 { margin: 0.0px 0.0px 0.0px 0.0px; line-height: 24.0px; font: 14.0px Arial; color: #323333; background-color: #f3feec }
span.s1 { font: 14.0px Arial }
span.s2 { color: #ffffff }
span.s3 { }
span.s4 { font: 11.0px "PingFang SC" }
span.s5 { font: 14.0px "Heiti SC Light" }
span.s6 { color: #2d64b3 }
span.s7 { font: 14.0px "Heiti SC Light"; color: #2d64b3 }
CATransition类实现层的转场动画。你可以从一组预定义的转换或者通过提供定制的CIFilter实例来指定转场效果。
例如:控制器之间的跳转
LoginViewController *myVC = [[LoginViewController alloc]init];
myVC.tuichu = @"tuichu";
//创建动画
CATransition *animation = [CATransition animation];
//设置运动轨迹的速度
animation.timingFunction = UIViewAnimationCurveEaseInOut;
//设置动画类型为立方体动画
animation.type = @"cube";
//设置动画时长
animation.duration =0.5f;
//设置运动的方向
animation.subtype =kCATransitionFromRight;
//控制器间跳转动画
[[UIApplication sharedApplication].keyWindow.layer addAnimation:animation forKey:nil];
[self presentViewController:myVC animated:NO completion:nil];
//例如;控制器中添加 view
CATransition *animation = [CATransition animation];
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.type = @"rippleEffect"; //声波效果
animation.duration = 0.3;
animation.subtype = kCATransitionFromBottom;
[self.view.layer addAnimation:animation forKey:nil];
[self.view addSubview:view];
//定义个转场动画
CATransition *animation = [CATransition animation];
//转场动画持续时间
animation.duration = 0.2f;
//计时函数,从头到尾的流畅度???
animation.timingFunction=UIViewAnimationCurveEaseInOut;
//转场动画类型
animation.type = kCATransitionReveal;
//转场动画将去的方向
animation.subtype = kCATransitionFromBottom;
//动画时你需要的实现
self.tabBarController.tabBar.hidden = YES;
//添加动画 (转场动画是添加在层上的动画)
self.tabBarController.tabBar.layer addAnimation:animation forKey:@"animation"];
说明:
duration:动画持续的时长。
timingFunction:没明白(谁明白的说明一下吧)
type:转场动画的类型。如果在一个自定义的转场动画中指定的过滤器属性,此属性将被忽略。
type共有四种类型:
NSString * const kCATransitionFade;//逐渐消失
NSString * const kCATransitionMoveIn;//移入
NSString * const kCATransitionPush;//平移(暂且这么称呼吧)
NSString * const kCATransitionReveal;//显露
默认类型为kCATransitionFade。
subtype:转场动画将要去往的方向。
subtpye有四种类型:
NSString * const kCATransitionFromRight;
NSString * const kCATransitionFromLeft;
NSString * const kCATransitionFromTop;
NSString * const kCATransitionFromBottom;
默认方向是nil。
[self.tabBarController.tabBar.layer addAnimation:animation forKey:@"animation"];
转场动画是添加给layer的!
switch (btn.tag) {
case 0:
animation.type = @"cube";//---立方体
break;
case 1:
animation.type = @"suckEffect";//103 吸走的效果
break;
case 2://前后翻转效果
animation.type = @"oglFlip";//When subType is "fromLeft" or "fromRight", it's the official one.
break;
case 3:
animation.type = @"rippleEffect";//110波纹效果
break;
case 4:
animation.type = @"pageCurl";//101翻页起来
break;
case 5:
animation.type = @"pageUnCurl";//102翻页下来
break;
case 6:
animation.type = @"cameraIrisHollowOpen ";//107//镜头开
break;
case 7:
animation.type = @"cameraIrisHollowClose ";//106镜头关
break;
default:
break;
}
iOS 页面之间的专长动画控制器间的转换的更多相关文章
- iOS 页面之间的转场动画控制器间的转换
CATransition类实现层的转场动画.你可以从一组预定义的转换或者通过提供定制的CIFilter实例来指定转场效果. 例如:控制器之间的跳转 LoginViewController *myVC ...
- IOS 页面之间的传值(主讲delegate)
IOS的Delegate,通俗一点说就是页面之间的传值. 总结一下现在知道的IOS页面之间传值的方式有三种 1.使用NSNotification发送通知的传值 主要是通过NSNotificationC ...
- IOS 页面之间的跳转
1.UINavigationController popToViewController 对应popViewControllerAnimated: 也可以使用: [self.navigationCon ...
- AngularJs开发——指令与控制器间的通信
(原文:http://www.html5jscss.com/controller-between-directive.html) 指令与控制器之间通信,跟控制器间的通信.指令间通信也类似,也是下几种方 ...
- IOS 在控制器间跳转实现过渡动画
已经掌握了CALayer下的CATransition动画在同一个控制器下实现,但是在不同控制器间跳转又该如何实现呢? MyViewController *myVC = [[MyViewControll ...
- iOS页面间传值的六种方式
一般ios页面间的传值方式分为6种:1.属性传值:2.block:3.delegate:4.UserDefault:5.单例:6.通知. 0&1.block 先说我最常用的block吧,属性传 ...
- iOS页面间传值的方式(Delegate/NSNotification/Block/NSUserDefault/单例)
iOS页面间传值实现方法:1.通过设置属性,实现页面间传值:2.委托delegate方式:3.通知notification方式:4.block方式:5.UserDefault或者文件方式:6.单例模式 ...
- ios页面间传递参数四种方式
ios页面间传递参数四种方式 1.使用SharedApplication,定义一个变量来传递. 2.使用文件,或者NSUserdefault来传递 3.通过一个单例的class来传递 4.通过Dele ...
- iOS页面间传值的方式(NSUserDefault/Delegate/NSNotification/Block/单例)
iOS页面间传值的方式(NSUserDefault/Delegate/NSNotification/Block/单例) 实现了以下iOS页面间传值:1.委托delegate方式:2.通知notific ...
随机推荐
- Python argparse模块实现模拟 linux 的ls命令
python 模拟linux的 ls 命令 sample: python custom_ls.py -alh c:/ 选项: -a ,--all 显示所有文件,包括'.'开头的隐藏文件 -l 列表显 ...
- Chapter 8: Exceptional Control Flow
概述: 我们可以用一种“流”的概念来理解处理器的工作流程,PC(Program Counter)依次为a0,a1,a2,...,an-1,这个序列可以称作control flow.当然我们并不总是按顺 ...
- 常见优化算法统一框架下的实现:最速下降法,partan加速的最速下降法,共轭梯度法,牛顿法,拟牛顿法,黄金分割法,二次插值法
常见优化算法实现 这里实现的主要算法有: 一维搜索方法: 黄金分割法 二次差值法 多维搜索算法 最速下降法 partan加速的最速下降法 共轭梯度法 牛顿法 拟牛顿法 使用函数表示一个用于优化的目标, ...
- postman接口测试系列:接口参数化和参数的传递
接着上一个章节时间戳和加密继续,上一节中我们使用Pre-Request Script可以正确获取时间戳和加密后的数据,接口响应结果也达到了预期目标.这里先简单说明一下接口的用例设计的测试点,截图所示 ...
- States字段的使用规范
背景 为了统一数据库表的状态字段,统一数据库表设计,简化字段在程序开发中的使用方式. 解决方式 States对应位域枚举StatesFlags. /// <summary> /// 数据状 ...
- 制作支持 BIOS+UEFI 的 U 盘 grub2+bootmgr 引导 + deepin_recovery + deepin_iso + win_pe
网盘下载:https://pan.baidu.com/s/1c2GXPo0 U盘为 FAT32,MBR分区表 1.下载:U盘grub2+bootmgr引导2017.12.6.2.7z 2.解压到 U盘 ...
- Prim算法模板
//Gang #include<iostream> #include<cstring> #include<algorithm> #include<cstdio ...
- ACM个人零散知识点整理
ACM个人零散知识点整理 杂项: 1.输入输出外挂 //读入优化 int 整数 inline int read(){ int x=0,f=1; char ch=getchar(); while(ch& ...
- memcache调整value大小限制
> *事件背景: 当Redis有问题时按预案就会切换到本机memcache,但是我们首页 key:value现 在是1.5M同时memcache item限制是1M,导致首页写入memcache ...
- Selenium中如何使用xpath更快定位
在学习Selenium路上,踩了也不少坑,这是我最近才发现的一个新写法,好吧,"才发现"又说明我做其他事了.对的,我现在还在加班! 开车~~~ 例子:知乎网 标签:Python3. ...