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];//关闭动画
 
 

iOS开发动画(Animation)总结的更多相关文章

  1. iOS开发--动画(Animation)总结

    UIView的,翻转.旋转,偏移,翻页,缩放,取反的动画效果   翻转的动画 //开始动画 [UIView beginAnimations:@"doflip" context:ni ...

  2. iOS 开发--动画

    在iOS开发中,制作动画效果是最让开发者享受的环节之一.一个设计严谨.精细的动画效果能给用户耳目一新的效果,吸引他们的眼光 —— 这对于app而言是非常重要的.我们总是追求更为酷炫的实现,如果足够仔细 ...

  3. iOS开发 - Core Animation 核心动画

    Core Animation Core Animation.中文翻译为核心动画,它是一组很强大的动画处理API,使用它能做出很炫丽的动画效果.并且往往是事半功倍. 也就是说,使用少量的代码就能够实现很 ...

  4. iOS开发--动画篇之layout动画深入

    "不得不说,单单是文章的标题,可能不足以说明本文的内容.因此,在继续讲述约束动画之前,我先放上本文要实现的动画效果." 编辑:Bison投稿:Sindri的小巢 约束动画并不是非常 ...

  5. iOS开发——动画OC篇&知识点总结

    图层与动画知识点总结 1.Core Animation 非娱乐类的软件都会用到的动画,操作简单. 2.Quartz 2D绘图 是一个2D绘图引擎. (1) 绘图Context是一个绘图的目标对象,定义 ...

  6. iOS开发——动画篇Swift篇&动画效果的实现

    Swift - 动画效果的实现   在iOS中,实现动画有两种方法.一个是统一的animateWithDuration,另一个是组合出现的beginAnimations和commitAnimation ...

  7. iOS开发——动画编程Swift篇&(五)CAKeyframeAnimation

    CAKeyframeAnimation //CAKeyframeAnimation-关键针动画 @IBAction func cakFly() { let animation = CAKeyframe ...

  8. iOS开发——动画编程Swift篇&(四)CABasicAnimation动画

    CABasicAnimation动画 //CABasicAnimation-不透明度 @IBAction func cabOpacity() { let animation = CABasicAnim ...

  9. iOS开发——动画篇Swift篇&常用动画总结

    UIView动画: UIView动画时最基本的动画,是直接对我们界面上控件进行简单的动画效果实现,如果你只需要用到一些简单的效果,那么这个很适合你,关于UIView动画实现恨简单, UIKit直接将动 ...

随机推荐

  1. [转载]2.6 UiPath循环嵌套的介绍和使用

    一.循环嵌套的介绍 一个循环体内又包含另一个完整的循环结构,就称之为循环嵌套.内嵌的循环中还可以嵌套循环,这就是多层循环,也叫做多重循环. 二.在UiPath中结合使用循环嵌套生成99乘法表 1.打开 ...

  2. 映客直播软开校招岗(go语言)

    问题: 笔试: 比较简单,有一道题比较深刻: 内存1G,需要计算1G的数据排序,哪种排序方法效率最低,当时选的是冒泡,因为涉及到频繁的数据交换,其实应该是归并,因为归并不是原地排序,多占用的内存空间, ...

  3. deepin 15.11添加应用启动图标

    以postman为例(路径要按需修改) 1.建立软链接 sudo ln -s /home/lixing/software/Postman/Postman /usr/bin/postman 前面地址为安 ...

  4. oracle实现"limit"功能

    转载于http://blog.sina.com.cn/s/blog_67e2758d0100s3oc.html oracle数据库不支持mysql中limit功能,但可以通过rownum来限制返回的结 ...

  5. Centos7編譯安裝LAMP平臺

    什麽是LAMP? 拆開看 L 就是Linux系統 A是Apache的縮寫 M.P則是MySQL和PHP的简写. 其实就是把Apache, MySQL以及PHP安装在Linux系统上,组成一个环境来运行 ...

  6. caffe网络在多线程中无法使用GPU的解决方案 | cpp caffe net run in multiple threads

    本文首发于个人博客https://kezunlin.me/post/8d877e63/,欢迎阅读! cpp caffe net run in multiple threads Guide set_mo ...

  7. 启动elasticsearch

       - name: source env      shell: source /etc/profile    - name: make elastic permission      shell: ...

  8. beta week 1/2 Scrum立会报告+燃尽图 02

    此作业要求参见https://edu.cnblogs.com/campus/nenu/2019fall/homework/9912 一.小组情况 队名:扛把子 组长:孙晓宇 组员:宋晓丽 梁梦瑶 韩昊 ...

  9. python3 之 匿名函数

    一.语法: lambda 参数:方法(或三元运算) #最多支持3元运算 二.实例1:基础 #函数1: a = lambda x:x*x print(a(2)) #函数2: def myfun(x): ...

  10. Java虚拟机之栈

    一.程序计数器(寄存器):PCR 作用:记住下一条JVM指令的执行地址. 特点:①线程私有的 ②不会存在内存溢出 二.虚拟机栈 1.定义 虚拟机栈:线程运行所需要的内存空间. 栈帧:一个栈帧对应一个方 ...