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开发之进阶篇第一章 - 姿势识别器UIPanGestureRecognizer

    今天讲一下姿势识别器,UIGestureRecognizer这个是抽象类 1.拍击UITapGestureRecognizer (任意次数的拍击) 2.向里或向外捏UIPinchGestureReco ...

  2. Liferay7 BPM门户开发之32: 实现自定义认证登陆(定制Authentication Hook)

    第一步:修改liferay-hook.xml <?xml version="1.0"?> <!DOCTYPE hook PUBLIC "-//Lifer ...

  3. Cause for NullPointerException android.support.v7.widget.RecyclerView.onMeasure

    because you have not set LinearLayoutManager to RecyclerView. for example: mRecyclerView = (Recycler ...

  4. spring scope="prototype", scope="session"

    转自: http://www.cnblogs.com/JemBai/archive/2010/11/10/1873954.html struts+spring action应配置为scope=&quo ...

  5. 针对不同的Cookie做页面缓存

    有时我们需要为PC浏览器及移动浏览器生成不同的页面,为了提高性能,不能每次请求都去判断User-Agent,通常用一个 Cookie 标记一下客户端是否是移动客户端,这样只需要读取这个 Cookie ...

  6. context:annotation-config 与context:component-scan

    <context:annotation-config/> <context:component-scan base-package="com.xx" /> ...

  7. [数据库]SQL Server 用户NT AUTHORITY\IUSR 登录失败

    今天打开网站时,突然报这个错误,平时都好好的 Cannot open database "JMECC" requested by the login. The login fail ...

  8. linux shell脚本备份mysql数据库

    #!/bin/sh # 备份数据库 # Mysql 用户名密码 MYSQL_USER=root MYSQL_PASS=root BACKUP_DIR=/data/backup/mysql DATA_D ...

  9. Conway's Game of Life: An Exercise in WPF, MVVM and C#

    This blog post was written for the Lockheed Martin Insight blog, sharing here for the external audie ...

  10. 【linux】——FreeBSD 建立 SSH 连接慢的解决方法

    一般在编写 linux 程序的时候,会使用 SecureCRT 或者 xshell 等工具远程登录到 linux 服务器上.最近发现在建立 SSH 连接的时候,非常慢,但是建立连接成功之后可以正常使用 ...