Core Animation 学习
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 学习的更多相关文章
- Core Animation学习总结
文件夹: The Layer Beneath The Layer Tree(图层树) The Backing Image(寄宿层) Layer Geometry(图层几何学) Visual Effec ...
- iOS Core Animation学习总结(1)--CALayer常用属性
图层是core animation的基础, UIView之所以能显示在屏幕上,靠的是其内部的这个图层,即每个UIView 都有 CALayer,可通过UIView.layer或者[UIView lay ...
- Instruments学习之Core Animation学习
当App发展到一定的规模,性能优化就成为必不可少的一点.但是很多人,又对性能优化很陌生,毕竟平常大多时间都在写业务逻辑,很少关注这个.最近在优化自己的项目,也收集了很多资料,这里先浅谈一下使用Inst ...
- iOS Core Animation学习总结(3)--动画的基本类型
一. CABasicAnimation (基础动画) 移位: CABasicAnimation *animation = [CABasicAnimation animation]; //keyPath ...
- iOS Core Animation学习总结(2)--实现自定义图层
一. 创建图层继承于CALayer,并在子类实现drawInContext方法 @interface CTLayer : CALayer @end @implementation CTLayer -( ...
- 转 iOS Core Animation 动画 入门学习(一)基础
iOS Core Animation 动画 入门学习(一)基础 reference:https://developer.apple.com/library/ios/documentation/Coco ...
- iOS Core Animation 动画 入门学习(一)基础
reference:https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide ...
- IOS Core Animation Advanced Techniques的学习笔记(五)
第六章:Specialized Layers 类别 用途 CAEmitterLayer 用于实现基于Core Animation粒子发射系统.发射器层对象控制粒子的生成和起源 CAGradient ...
- IOS Core Animation Advanced Techniques的学习笔记(四)
第五章:Transforms Affine Transforms CGAffineTransform是二维的 Creating a CGAffineTransform 主要有三种变 ...
随机推荐
- gulp学习笔记3
gulp系列学习笔记: 1.gulp学习笔记1 2.gulp学习笔记2 3.gulp学习笔记3 4.gulp学习笔记4 1.编译sass Sass 是一种 CSS 的开发工具,提供了许多便利的写法,大 ...
- 记忆化搜索hdu1078 dfs
http://acm.hdu.edu.cn/showproblem.php?pid=1078 题意:给出n*n的格子,每个各自里面有些食物,问一只老鼠每次走最多k步所能吃到的最多的食物 #includ ...
- [转] java.lang.IllegalArgumentException: Document base D:\apache-tomcat-7.0.47\webapps\XXX错误
启动服务器,报上述错误,是因为在服务器中(如tomcat)删除了某项目,单残留的配置文件没删除造成的.解决办法是到服务器中找到conf\Catalina\localhost下找到错误信息中对应的配置文 ...
- android: 接收和发送短信
8.2 接收和发送短信 收发短信应该是每个手机最基本的功能之一了,即使是许多年前的老手机也都会具备这 项功能,而 Android 作为出色的智能手机操作系统,自然也少不了在这方面的支持.每个 A ...
- samba权限之easy举例说明--原创
实验环境RHEL5.0,samba3.023rc-2 一.何为browsealbe=no? 如图lingdao目录的权限为777 如图ling目录的共享设置和用户的ID和组 当用户lingdao_01 ...
- 用 Mahout 和 Elasticsearch 实现推荐系统
原文地址 本文内容 软件 步骤 控制相关性 总结 参考资料 本文介绍如何用带 Apache Mahout 的 MapR Sandbox for Hadoop 和 Elasticsearch 搭建推荐引 ...
- 机器学习技法--学习笔记04--Soft SVM
背景 之前所讨论的SVM都是非常严格的hard版本,必须要求每个点都被正确的区分开.但是,实际情况时很少出现这种情况的,因为噪声数据时无法避免的.所以,需要在hard SVM上添加容错机制,使得可以容 ...
- IOS中的多线程之GCD
在ios中,使用多线程有三种方式,分别是:NSThread.NSOperation和NSOperationQueue.GCD,在本节,主要讲解一下CDD的使用. GCD(Grand Central D ...
- 使用sqlserver的游标功能来导数据的常见写法
一定要自己试过才知道么? 你也没试过吃屎,你怎么知道屎不能吃,难道你试过啊...(没有愤怒的意思) ),),) declare cursor_data CURSOR FOR SELECT [UserN ...
- Lumia 830 win10m 启用触摸按键
用了一年半的830疑似翘屏… 按键基本失灵 每次按的时候基本都是 appbar 那里有反映… 实在懒于换手机(主要是不想花钱…) 研究下怎么启用虚拟按键,还能再战几年… 启用虚拟按键 其实简单说法就是 ...