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. openstack七大模块概述
  2. transient的使用
  3. SVN钩子说明
  4. Android开发--Layout元素
  5. 详解 jupyter notebook 集成 spark 环境安装
  6. NOI2010超级钢琴 2
  7. ClassLoader(摘录)
  8. Centos yum install
  9. ASCII码表及键盘码表。
  10. CSS hack大全&详解(什么是CSS hack)
  11. 单机千万级MQTT连接服务器测试报告
  12. [dev]typeof, offsetof 和container_of
  13. 【NOI2002】
  14. linqjs
  15. Confluence 6 临时目录(安装目录)
  16. CSS预处理器之less
  17. 何为用户体验?附《用户体验的要素》PDF版下载
  18. gentoo系统安装
  19. 华为推送 简介 集成 MD
  20. git 场景 :从一个分支cherry-pick多个commit

热门文章

  1. dubbo中出现can not be invoked any more
  2. google在nature上发表的关于量子计算机的论文(Quantum supremacy using a programmable superconducting processor 译)— 附论文
  3. JVM 运行参数 & 代码监控
  4. CSS如何设置列表样式属性
  5. pat 1124 Raffle for Weibo Followers(20 分)
  6. 附009.Kubernetes永久存储之GlusterFS独立部署
  7. C语言1博客作业01
  8. shell脚本3——调试
  9. 逆向libbaiduprotect(二)
  10. ReentreantLock:重入锁