iOS开发动画(Animation)总结
来源:互联网 发布:网络霸气情侣名 编辑:程序博客网 时间:2024/06/05 08:07
动画浅析-CAAnimation和CATransition
[_imgPic setImage:image];// 设置新的图片
@interface CATransition : CAAnimation
CAAnimation
CAMediaTiming
CAAction
protocols.CAMediaTiming协议
可以调整时间,包括持续时间,速度,重复次数。
CAAction协议
可以通过响应动作的方式来显示动画。
CAAnimation有很多派生类
CATransition 提供渐变效果:(推拉push效果,消退fade效果,揭开reveal效果)。
CAAnimationGroup 允许多个动画同时播放。
CABasicAnimation 提供了对单一动画的实现。
CAKeyframeAnimation 关键桢动画,可以定义行动路线。
CAConstraint 约束类,在布局管理器类中用它来设置属性。
CAConstraintLayoutManage
CATransaction 事务类,可以对多个layer的属性同时进行修改.它分隐式事务,和显式事务。
delegate
removedOnCompletion
defaultValueForKey
shouldArchiveValueForKey
animationDidStart
animationDidStop:finished
UIView的,翻转、旋转,偏移,翻页,缩放,取反的动画效果
翻转的动画
//开始动画 [UIView beginAnimations:@"doflip" context:nil]; //设置时常 [UIView setAnimationDuration:1]; //设置动画淡入淡出 [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; //设置代理 [UIView setAnimationDelegate:self]; //设置翻转方向 [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:manImageView cache:YES]; //动画结束 [UIView commitAnimations];旋转动画
//创建一个CGAffineTransform transform对象 CGAffineTransform transform; //设置旋转度数 transform = CGAffineTransformRotate(manImageView.transform,M_PI/6.0); //动画开始 [UIView beginAnimations:@"rotate" context:nil ]; //动画时常 [UIView setAnimationDuration:2]; //添加代理 [UIView setAnimationDelegate:self]; //获取transform的值 [manImageView setTransform:transform]; //关闭动画 [UIView commitAnimations];偏移动画
[UIView beginAnimations:@"move" context:nil]; [UIView setAnimationDuration:2]; [UIView setAnimationDelegate:self]; //改变它的frame的x,y的值 manImageView.frame=CGRectMake(100,100, 120,100); [UIView commitAnimations];
[UIView beginAnimations:@"curlUp" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//指定动画曲线类型,该枚举是默认的,线性的是匀速的
//设置动画时常 [UIView setAnimationDuration:1]; [UIView setAnimationDelegate:self]; //设置翻页的方向 [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:manImageView cache:YES]; //关闭动画 [UIView commitAnimations];
缩放动画
CGAffineTransform transform; transform = CGAffineTransformScale(manImageView.transform,1.2,1.2); [UIView beginAnimations:@"scale" context:nil]; [UIView setAnimationDuration:2]; [UIView setAnimationDelegate:self]; [manImageView setTransform:transform]; [UIView commitAnimations];
取反的动画效果是根据当前的动画取他的相反的动画
CGAffineTransform transform; transform=CGAffineTransformInvert(manImageView.transform); [UIView beginAnimations:@"Invert" context:nil]; [UIView setAnimationDuration:2];//动画时常 [UIView setAnimationDelegate:self]; [manImageView setTransform:transform];//获取改变后的view的transform [UIView commitAnimations];//关闭动画
- iOS开发动画(Animation)总结
- iOS开发动画(Animation)总结
- iOS开发动画(Animation)总结
- iOS开发动画(Animation)总结
- iOS开发动画总结(Animation)
- iOS 动画(Animation)总结
- IOS开发UI篇--IOS动画(Core Animation)总结
- iOS开发UI篇--iOS动画(Core Animation)总结
- IOS开发UI篇--IOS动画(Core Animation)总结
- iOS开发UI篇--iOS动画(Core Animation)总结
- IOS开发UI篇--IOS动画(Core Animation)总结
- IOS开发UI篇--IOS动画(Core Animation)总结
- IOS开发UI篇--IOS动画(Core Animation)总结
- iOS开发:iOS动画(Core Animation)总结
- IOS开发UI篇--IOS动画(Core Animation)总结
- 【IOS功能实现】之Core Animation动画开发总结(CALayer)
- iiOS开发UI篇--IOS动画(Core Animation)总结
- IOS动画总结-Core Animation
- vagrant doc
- 追赶法求解三对角方程组
- 五个免费UML建模工具推荐
- jade模板引擎(二)
- Unity 和 Visual Studio Code ( VS Code ) 第三弹 - Unity Debugger Extension Preview
- iOS开发动画(Animation)总结
- 30 天学习 30 种新技术系列
- 通过用户名称获取微博id
- Oracle 自定义过程与函数
- Swift 开源(介绍和地址)
- 滑动切换activity
- 发生了一个Oracle错误,但无法从Oracle中检索错误信息的处理
- Eclipse中编写servlet时出现"The import javax.servlet cannot be resolved" 问题解决办法
- httpclient基础