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 主要有三种变 ...
随机推荐
- Leetcode 111 Minimum Depth of Binary Tree 二叉树
找出最短的从叶子到根的路径长 可以回忆Maximum Depth of Binary Tree的写法,只不过在!root,我把它改成了10000000,还有max函数改成了min函数,最后的值如果是1 ...
- ooj1057: M的整数倍DP
http://121.249.217.157/JudgeOnline/problem.php?id=1057 1057: M的整数倍 时间限制: 1 Sec 内存限制: 64 MB提交: 130 ...
- iOS开发网络篇—发送GET和POST请求(使用NSURLSession)
iOS开发网络篇—发送GET和POST请求(使用NSURLSession) 说明: 1)该文主要介绍如何使用NSURLSession来发送GET请求和POST请求 2)本文将不再讲解NSURLConn ...
- ios之VFL的补充(二)
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[languageI ...
- ORA-01033:ORACLE initialization or shutdown in progress
借用他人的经验 客户Oracle服务器进入PL/SQL Developer时报ora-01033:oracle initializationg or shutdown in progress 错误提示 ...
- Revit中如何将视图过滤器传递到其它项目
在Revit中采用过滤器控制视图显示,利用过滤器给图元着色,利用过滤器控制视图显示或隐藏等,那么,在不同的项目中是否每次都要设置相同的过滤器,其实,Revit提供了这么一种在不同项目传递信息的方式,在 ...
- django关闭debug后,静态文件的处理
Django框架仅在开发模式下提供静态文件服务.当我开启DEBUG模式时,Django内置的服务器是提供静态文件的服务的,所以css等文件访问都没有问题,但是关闭DEBUG模式后,Django便不提供 ...
- 【Vegas原创】EXCEL光标所在的行自动变色
方法: 1,excel中,按Alt+F11,打开VBA编辑界面,双击需要改的工作表名称,将下面代码粘贴到右边框中,即可. 2,代码: Private Sub Worksheet_Selection ...
- Python - 升级所有已安装的第三方包
我们有时候需要把系统上已经安装的第三方的packages升级到最新版.但是easy_install和pip都没有直接的命令可以使用. 我们可以是用如下命令来查看系统上面哪些包过期了. pip list ...
- MVC的JsonResult用法
在Asp.net Mvc 2中由于对数据的保护,默认情况下request为post,所以在前端请求的时候则需要以post方式request action方法: public JsonResult Ge ...