iOS 开发 动画总结
来源:互联网 发布:淘宝上买摩托车被骗了 编辑:程序博客网 时间:2024/05/17 04:55
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:@"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];//关闭动画
0 0
- iOS 开发 动画总结
- IOS动画开发总结
- 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 动画总结----UIView动画
- iOS 动画总结----UIView动画
- 数据结构实验之二叉树的建立与遍历
- Check the active user in the Application
- 网上找到的一段关于SAP支持服务的Q&A (转)
- 不是有了个“牛比”的通讯组件就能写好服务器程序的
- c++之菱形继承
- iOS 开发 动画总结
- JavaScript Puzzlers javascript解惑
- AVA概述(10) 函数(应用)
- 祝福自个儿
- 三四线城市如何把年轻人逼回北上广?
- linux下杀死进程的10种方法
- Keil教程(2)
- JS计算两个日期之间的天数
- 关于GWBASIC程序编码修改问题有没有大神能帮忙?