core animation 是在UIKit层之下的一个图形库,用于在iOS 和 OS X 实现动画。

Core Animation管理App内容

  core animation不是一个完整的绘图系统,它是将App内容合成、操纵并应用于硬件的一个基础框架。

  他的核心是Layer对象,大多情况,layer被用来管理view的内容,不过我们仍然可以创建独立的layer。

 Layer 修改触发动画

  layer类似于view,有一些属性可以修改:bounds rectangle, a position onscreen, an opacity, a transform, and many other visually-oriented properties。

Layer可以被组织划分层次

  layer的层次类似于view的层次,有parent-child的关系。

Action 使我们可以改变Layer的默认特性

  隐式动画由action完成,core animation使用action实现layer相关的动画集合。action也可以自定义。


为Layer设置内容

  1.给layer对象的contents属性直接赋值为image对象。(这种方式适合那种永远或者很少变动的layer 内容)

  2.给layer指定一个delegate,由delegate绘制layer的内容。(这种方式适合那种有周期变动的layer的内容,或者使用其他对象提供给layer content的)

  3.定义一个layer的子类,并且复写绘制方法,从而创建内容。(这种方式适合你必须要子类化layer,或者你想改变layer的基本绘制机制)


CABasicAnimation :基本动画
CAKeyframeAnimation :关键帧动画
CATransitionAnimation :变换动画

model layer 和 presenttation layer

Core Animation 维护了两个平行 layer 层次结构:
 1.model layer tree(模型层树) 
 2.presentation layer tree(表示层树) 关于postion、anchorpoint的一个文章,不错:
http://wonderffee.github.io/blog/2013/10/13/understand-anchorpoint-and-position/


fromValue toValue byValue 1.fromValue toValue都不为nil,改变将会是从fromValue->toValue
2.fromValue byValue都不为nil,改变将会是从fromValue->(fromValue+byValue)
3.byValue toValue不为nil,改变将会是从(toValue-byValue)->toValue
4.fromValue不为nil,改变将会是从fromValue->当前展示位置的value
5.toValue不为nil,改变将会是从当前展示的value->toValue
6.byValue不为nil,改变将是会从当前展示的value->当前展示的value+byValue
7.fromValue toValue byValue都为nil,改变是从之前的value->当前设置的value

CATransform3D 

参考:
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html
http://zsisme.gitbooks.io/ios-/content/index.html
http://objccn.io/issue-12-1/  
http://blog.sina.com.cn/s/blog_a5243c7f0102v17c.html

Core Animation 学习的更多相关文章

  1. Core Animation学习总结

    文件夹: The Layer Beneath The Layer Tree(图层树) The Backing Image(寄宿层) Layer Geometry(图层几何学) Visual Effec ...

  2. iOS Core Animation学习总结(1)--CALayer常用属性

    图层是core animation的基础, UIView之所以能显示在屏幕上,靠的是其内部的这个图层,即每个UIView 都有 CALayer,可通过UIView.layer或者[UIView lay ...

  3. Instruments学习之Core Animation学习

    当App发展到一定的规模,性能优化就成为必不可少的一点.但是很多人,又对性能优化很陌生,毕竟平常大多时间都在写业务逻辑,很少关注这个.最近在优化自己的项目,也收集了很多资料,这里先浅谈一下使用Inst ...

  4. iOS Core Animation学习总结(3)--动画的基本类型

    一. CABasicAnimation (基础动画) 移位: CABasicAnimation *animation = [CABasicAnimation animation]; //keyPath ...

  5. iOS Core Animation学习总结(2)--实现自定义图层

    一. 创建图层继承于CALayer,并在子类实现drawInContext方法 @interface CTLayer : CALayer @end @implementation CTLayer -( ...

  6. 转 iOS Core Animation 动画 入门学习(一)基础

    iOS Core Animation 动画 入门学习(一)基础 reference:https://developer.apple.com/library/ios/documentation/Coco ...

  7. iOS Core Animation 动画 入门学习(一)基础

    reference:https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide ...

  8. IOS Core Animation Advanced Techniques的学习笔记(五)

    第六章:Specialized Layers   类别 用途 CAEmitterLayer 用于实现基于Core Animation粒子发射系统.发射器层对象控制粒子的生成和起源 CAGradient ...

  9. IOS Core Animation Advanced Techniques的学习笔记(四)

    第五章:Transforms   Affine Transforms   CGAffineTransform是二维的     Creating a CGAffineTransform   主要有三种变 ...

随机推荐

  1. iOS开发-UIScrollView原理

    UIScrollView在开发中是不可避免,关于UIScrollView都有自己一定的理解.滚动视图有两个需要理解的属性,frame和bounds,frame是定义了视图在窗口的大小和位置,bound ...

  2. gcc5.1.0升级指南

    请使用root权限用控制台安装gcc5.1.0(重要) 1.首先把旧的gcc相关的编译工具安装好(没有安装会导致后面的错误) yum upgrade gcc //升级gcc库 yum -y insta ...

  3. CSS水平垂直居中总结

    行内元素水平居中 把行内元素包裹在块级父元素中,且父元素中的css设置text-align:center; <!DOCTYPE html> <html> <head> ...

  4. hashcode详解

    序言 写这篇文章是因为在看hashMap源码时遇到有什么hashcode值,然后就去查,脑袋里面是有映像的,不就是在Object中有equals和hashcode方法嘛,这在学java基础的时候就遇到 ...

  5. 远哥教你MuleESB系列视频教程

    远哥教你MuleESB系列视频课程介绍(共11个视频) —1.Mule ESB介绍 —2.社区版/企业版的区别和安装 —3.MuleESB快速入门,以及MEL和Message结构 —4.官方例子讲解( ...

  6. 今天踩过的坑——structs和phpmyadmin

    phpmyadmin 错误:缺少 mcrypt 扩展解决mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/sudo php5enmo ...

  7. 小白学数据分析----->什么才是留存率的关键?

    最近花了很多的时间在体验各种游戏,从火爆的卡牌,到策略,RPG等等,有一个问题在影响我,什么才是留存率的关键?今天就先讨论一些我的想法. 留存率已经成为大家最常提到的词汇,也是拿出来show一下的武器 ...

  8. ELK——为调试 Logstash Grok 表达式,安装 GrokDebuger 环境

      内容 安装 RVM 安装 Ruby 和 Gems 安装 Rails 安装 jls-grok Ruby grok 解析 调试 grok 注意:不要用 root 执行以下操作. 用 logstash ...

  9. C++ STL 学习 :for_each与仿函数(functor)

    简单来将,仿函数(functor)就是一个重载了"()"运算符的struct或class,利用对象支持operator()的特性,来达到模拟函数调用效果的技术. 我们平时对一个集合 ...

  10. android 中handler的用法分析 (二)

    .Looper 的构造方法是私有的,不能在package外面直接初始化.一般通过Looper.prepare()初始化.Looper.myLooper()获取.2.Looper 中的静态变量 Thre ...