UIView的,翻转、旋转,偏移,翻页,缩放,取反的动画效果

 
翻转的动画

  1. //开始动画
  2. [UIView beginAnimations:@"doflip" context:nil];
  3. //设置时常
  4. [UIView setAnimationDuration:1];
  5. //设置动画淡入淡出
  6. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
  7. //设置代理
  8. [UIView setAnimationDelegate:self];
  9. //设置翻转方向
  10. [UIView setAnimationTransition:
  11. UIViewAnimationTransitionFlipFromLeft  forView:manImageView cache:YES];
  12. //动画结束
  13. [UIView commitAnimations];
旋转动画
  1. //创建一个CGAffineTransform  transform对象
  2. CGAffineTransform  transform;
  3. //设置旋转度数
  4. transform = CGAffineTransformRotate(manImageView.transform,M_PI/6.0);
  5. //动画开始
  6. [UIView beginAnimations:@"rotate" context:nil ];
  7. //动画时常
  8. [UIView setAnimationDuration:2];
  9. //添加代理
  10. [UIView setAnimationDelegate:self];
  11. //获取transform的值
  12. [manImageView setTransform:transform];
  13. //关闭动画
  14. [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];

 
翻页动画
  1. [UIView beginAnimations:@"curlUp" context:nil];
  2. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];//指定动画曲线类型,该枚举是默认的,线性的是匀速的
  3. //设置动画时常
  4. [UIView setAnimationDuration:1];
  5. [UIView setAnimationDelegate:self];
  6. //设置翻页的方向
  7. [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:manImageView cache:YES];
  8. //关闭动画
  9. [UIView commitAnimations];
 
 
缩放动画
  1. CGAffineTransform  transform;
  2. transform = CGAffineTransformScale(manImageView.transform,1.2,1.2);
  3. [UIView beginAnimations:@"scale" context:nil];
  4. [UIView setAnimationDuration:2];
  5. [UIView setAnimationDelegate:self];
  6. [manImageView setTransform:transform];
  7. [UIView commitAnimations];
 
取反的动画效果是根据当前的动画取他的相反的动画
 
  1. CGAffineTransform transform;
  2. transform=CGAffineTransformInvert(manImageView.transform);
  3. [UIView beginAnimations:@"Invert" context:nil];
  4. [UIView setAnimationDuration:2];//动画时常
  5. [UIView setAnimationDelegate:self];
  6. [manImageView setTransform:transform];//获取改变后的view的transform
  7. [UIView commitAnimations];//关闭动画

最新文章

  1. 【转】Windows平台下的Subversion安装配置新手指南
  2. 如何在Eclipse中查看JDK的源代码
  3. jQuery中animate的height的自适应
  4. 「Unity」与iOS、Android平台的整合:2、导出的Android-Eclipse工程
  5. [Python] Magic editor in Pycharm
  6. springJDBC实现查询方法二
  7. ORA-01461: 仅可以为插入 LONG 列的 LONG 值赋值”解决办法
  8. LIBPNG使用小结(二)
  9. phpMyAdmin配置及 错误 缺少 mysqli 扩展。请检查 PHP 配置
  10. 最受欢迎telnet
  11. 转:web_custom_request 函数
  12. rails使用QQ邮箱发送邮件蛋疼的经历
  13. GDB程序调试工具
  14. Vs2017 无法调试APP
  15. css3 特效拓展 画个安卓机器人
  16. OpenGL——OpenCV与SOIL读取图片进行纹理贴图
  17. 国内+海外IDC资源合作
  18. MySQLi面向对象实践--select
  19. MySQL分页存储过程
  20. HTTP从入门到入土(3)——TCP三次握手

热门文章

  1. Json.Net使用JSON Schema验证JSON格式【实例】
  2. P1643: [Usaco2007 Oct]Bessie's Secret Pasture 贝茜的秘密草坪
  3. python-day3-集合
  4. 2014103《JAVA程序设计》第一周学习总结
  5. 20145120 《Java程序设计》第9周学习总结
  6. 02.JSP的3个编译指令
  7. 【POJ】【2449】Remmarguts' Date
  8. dblink应用
  9. log4j 配置实例
  10. IIS8托管WCF服务