使用CABasicAnimation动画:

   

   CALayer *znzLayer; = [[CALayer alloc]init];
//创建不断该表CALayer的transform属性动画
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"transform"];
CATransform3D fromValue = znzLayer.transform;
//设置动画开始的属性值
anim.fromValue = [NSValue valueWithCATransform3D:fromValue];
//绕z轴旋转heading弧度的变换矩阵
CATransform3D toValue = CATransform3DMakeRotation(headings, 0, 0, 1);
//设置动画结束的属性
anim.toValue = [NSValue valueWithCATransform3D:toValue];
anim.duration = 0.5;//持续时间
anim.removedOnCompletion = YES; //如果需要继续使用本动画可以不用设置该属性,默认为NO,
//设置动画结束后anzLayer的变换矩阵
znzLayer.transform = toValue;
//为znzLayer添加动画
[znzLayer addAnimation:anim forKey:nil];

    http://blog.csdn.net/yuhuangc/article/details/7594979,其他用法链接

CABasicAnimation动画的更多相关文章

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

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

  2. iOS开发CABasicAnimation动画理解

    1.CALayer简介 CALayer是个与UIView很类似的概念,同样有backgroundColor.frame等相似的属性,我们可以将UIView看做一种特殊的CALayer.但实际上UIVi ...

  3. CABasicAnimation动画及其keypath值和作用

    //tarnsform放大缩小动画 CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transf ...

  4. Core Animation之CABasicAnimation(基础动画)

    #import "ViewController.h" @interface ViewController () @property(nonatomic,strong)UIButto ...

  5. 再谈CAAnimation动画

    CAAnimaton动画分为CABasicAnimation & CAKeyframeAnimation CABasicAnimation动画, 顾名思义就是最基本的动画, 老规矩先上代码: ...

  6. iOS进阶_动画的多种实现方式

    一.UIView动画 //UIView动画有开始beginAnimation,有结束commitAnimation    //第一步:开始UIView动画    [UIView beginAnimat ...

  7. 【原】iOS学习44之动画

    1. 简单动画 1> UIImageView GIF 动画 GIF图的原理是:获取图片,存储在图片数组中,按照图片数组的顺序将图片以一定的速度播放 UIImageView *showGifima ...

  8. IOS开发-属性动画和关键帧动画的使用

    CAMediaTiming是一个协议(protocol),CAAnimation是所有动画类的父类,但是它不能直接使用,应该使用它的子类. 继承关系: CoreAnmiation 核心动画 简写CA ...

  9. CoreAnimation动画(CALayer动画)

    #pragma mark - CABasicAnimation动画 - (IBAction)basicAnimation:(UIButton *)sender { // 1.创建动画对象 CABasi ...

随机推荐

  1. Java高级程序设计笔记 • 【第5章 XML解析】

    全部章节   >>>> 本章目录 5.1 XML 文档概述 5.1.1 XML文档结构 5.1.1 XML结构说明 5.1.1 XML文档元素 5.1.2 XML文档语法规范 ...

  2. springboot单元测试为什么排除junit-vintage-engine

    https://blog.csdn.net/Ber_Bai/article/details/117001443 如果不排除,就需要使用@RunWith注解? 25-springboot整合单元测试指定 ...

  3. CF149D游戏

    题目描述 Petya遇到了一个关于括号序列的问题: 给定一个字符串S,它代表着正确的括号序列,即("(")与 (")")是匹配的.例如:"(())() ...

  4. 解构插槽 Prop

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <link rel ...

  5. MongoDB_文档存储结构(三)

    MongoDB 文档数据库的存储结构分为四个层次,从大到小依次是:数据库(database).集合(collection).文档(document).键值对. 图 1 描述了 MongoDB 与 My ...

  6. linux清理缓存cache

    Linux服务器有自己先进的内存管理机制,有时候会发现我们系统的buff/cache内存占用会越来越高,操作系统也有卡顿的情况,遇到这种情况,不妨试试下面的方法. 步骤一:我们先使用free -m查看 ...

  7. 为 MySQL 的 root 用户设置一个密码。

    shell> mysqladmin --user=root password somepasswordshell> mysqladmin --user=root --password re ...

  8. php.ini配置文件中设置时区

    date.timezone设置php5默认date.timezone为utc,改为date.timezone = PRC即可解决时间相差八小时的问题

  9. Word2010制作倒福字

    原文: https://www.toutiao.com/i6489772955797553677/ 选择"插入"选项卡,"插图"功能组,"形状&quo ...

  10. vue render中如何正确配置img的路径

    第一种:适用于静态路径 attrs: { src: require('../common/images/logo.png'), title: 'img' } 第二种:适用于动态路径 domProps: ...