CATransition 动画
- [UIView commitAnimations];
[UIView beginAnimations:nil context:nil]; - [UIView setAnimationRepeatAutoreverses:YES];//动画是否返回
[UIView setAnimationDuration:0.3];
button.alpha =0;
[UIView commitAnimations]; - CATransition的type属性
- 1.#define定义的常量
- kCATransitionFade 交叉淡化过渡
- kCATransitionMoveIn 新视图移到旧视图上面
- kCATransitionPush 新视图把旧视图推出去
- kCATransitionReveal 将旧视图移开,显示下面的新视图
- 2.用字符串表示
- pageCurl 向上翻一页
- pageUnCurl 向下翻一页
- rippleEffect 滴水效果
- suckEffect 收缩效果,如一块布被抽走
- cube 立方体效果
- oglFlip 上下翻转效果
- - (void)MyCAnimation1 {
- CATransition *animation = [CATransition animation];
- //动画时间
- animation.duration = 1.0f;
- //display mode, slow at beginning and end
- animation.timingFunction = UIViewAnimationCurveEaseInOut;
- //过渡效果
- animation.type = kCATransitionMoveIn;
- //过渡方向
- animation.subtype = kCATransitionFromTop;
- //添加动画
- [imageView.layer addAnimation:animation forKey:nil];
- }
- - (void)MyCAnimation2 {
- CATransition *animation = [CATransition animation];
- //动画时间
- animation.duration = 1.0f;
- //display mode, slow at beginning and end
- animation.timingFunction = UIViewAnimationCurveEaseInOut;
- //在动画执行完时是否被移除
- animation.removedOnCompletion = NO;
- //过渡效果
- animation.type = @"pageCurl";
- //过渡方向
- animation.subtype = kCATransitionFromRight;
- //暂时不知,感觉与Progress一起用的,如果不加,Progress好像没有效果
- animation.fillMode = kCAFillModeForwards;
- //动画停止(在整体动画的百分比).
- animation.endProgress = 0.7;
- [imageView.layer addAnimation:animation forKey:nil];
- }
- - (void)MyCAnimation3 {
- CATransition *animation = [CATransition animation];
- //动画时间
- animation.duration = 1.0f;
- //display mode, slow at beginning and end
- animation.timingFunction = UIViewAnimationCurveEaseInOut;
- //过渡效果
- animation.type = @"pageUnCurl";
- //过渡方向
- animation.subtype = kCATransitionFromRight;
- //暂时不知,感觉与Progress一起用的,如果不加,Progress好像没有效果
- animation.fillMode = kCAFillModeBackwards;
- //动画开始(在整体动画的百分比).
- animation.startProgress = 0.3;
- [imageView.layer addAnimation:animation forKey:nil];
- }
- - (void)MyCAnimation4 {
- [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(updateButterfly) userInfo:nil repeats:YES];
- }
- - (void)updateButterfly {
- butterflyView.animationDuration = 0.75f;
- [self.view addSubview:butterflyView];
- [butterflyView startAnimating];
- butterflyView.center = [butterflyView randomCenterInView:self.view withInset:10.0f];
- }
转载于:https://www.cnblogs.com/gaoxiao228/archive/2012/05/04/2483580.html
CATransition 动画相关推荐
- (0034) iOS 开发之UIView动画(过渡效果)
UIView视图的动画功能,可以使在更新或切换视图时有放缓节奏.产生流畅的动画效果,进而改善用户体验.UIView可以产生动画效果的变化包括: 位置变化:在屏幕上移动视图. 大小变化:改变视图框架(f ...
- iOS简单动画实现方案
一.仿射变换--CGAffineTransform 1.仿射变换,一种基于二维坐标的转换功能.CGAffineTransform数据结构代表一个二维坐标系的转换矩阵. 2.通过CGAffineTran ...
- iOS开发之各种动画各种页面切面效果
转发:http://www.cocoachina.com/ios/20141226/10775.html 今天所介绍的主题是关于动画的,在之前的博客中也有用到动画的地方,今天就好好的总结一下iOS开发 ...
- ios 各种动画机制
关于 Core Animation Core Animation是一组非常强大的动画处理API,使用它能做出很多优雅的动画效果.能用的动画类有4个子类:CABasicAnimation.CAKeyfr ...
- iOS动画-CAAnimation使用详解
理解了隐式动画后,显式动画就更加通俗易懂了.区别于隐式动画的特点,显式动画就是需要我们明确指定类型.时间等参数来实现效果的动画.除此之外,我们也可以创建非线性动画,比如沿着任意一条曲线运动等: 我们平 ...
- iOS 简单动画汇总
iOS 简单动画主要分为三种(这是我的理解): 第一种:改变位置,大小等 //开始动画 [UIView beginAnimations:nil context:nil]; //设定动画持续时间 [UI ...
- IOS之 基本动画原理
IOS动画分为属性动画和过渡动画.ios4.0之前 属性动画 内容和设置主要放在方括号中既:如下 [UIView beginAnimations:@"move" context:@ ...
- iOS 10应用开发基础教程
iOS 10应用开发基础教程 介绍: 本教程是国内第一本iOS 10开发应用教程.本教程基于Xcode 8.0,使用Swift 3.0语言讲解如何开发iOS 10的应用App. 学习建议:本教程针对i ...
- [EGORefreshTableHeaderView]手动启动下拉更新的方法
原文地址:http://blog.csdn.net/ugg/article/details/7283661 Q:在EGORefreshTable中手动启动下拉更新的方法? A:EGORefreshTa ...
最新文章
- Python将所有的英文单词首字母变成大写
- R语言广义线性模型Logistic回归模型C Statistics计算
- python机器学习入门(Day11:ANN)
- 使用Poi读取xlsx类型的Excel
- 2020人工神经网络第一次作业-参考答案第七部分
- 重磅:苹果人工智能最完整解密,iBrain早已无处不在
- 从源代码解读spring之DataSource实现和FactoryBean模式(JndiObjectFactoryBean)
- 基于PHPUnit编写第一个测试用例
- 我学会了用计算机作文,我学会了做饭作文300字(通用10篇)
- 打破10倍速软件工程师神话
- 手把手教你强化学习 (九) 强化学习中策略梯度算法
- matlab离散信号与系统的时域分析
- oppo手机解锁_oppo手机密码解锁大全【图文】
- ACM/ICPC 2018亚洲区预选赛北京赛站网络赛 Tomb Raider
- 安装protobuf可能遇到的问题
- 武汉大学计算机转专业2021,通知|关于做好2021年普通本科生转专业工作的通知...
- 如何将平板电脑/手机作为电脑的扩展屏(附带软件下载)
- 封印者无法从更新服务器获取补丁文件,封印者客户端打不开怎么办 封印者客户端打不开解决办法一览...
- ansys显示没有提供服务器,ansys 15.0安装在服务器上,运行时出现问题,求大神帮助! - 第 2 页 - 仿真模拟 - 小木虫 - 学术 科研 互动社区...
- 薄膜收放卷张力控制问题