Core Animation之基础介绍
Core Animation可以翻译为核心动画,它为图形渲染和动画
提供了基础。使用核心动画,你只需要设置一些参数比如起点和终点,剩下的帧核心动画为你自动完成。核心动画使用硬件加速,不用消耗cpu资源。其实平时咱们开发的iOS应用都在有意无意的使用了核心动画。动画不会替代View,而是和View一起提供更好的性能。Core Animation通过缓存view上的内容到bitmap,这样bitmap就可以直接在图形硬件上操作。从而提高了性能。
Class |
Usage |
---|---|
CAEmitterLayer |
Used to implement a Core Animation–based particle emitter system. The emitter layer object controls the generation of the particles and their origin. |
CAGradientLayer |
Used to draw a color gradient that fills the shape of the layer (within the bounds of any rounded corners). |
CAEAGLLayer/CAOpenGLLayer |
Used to set up the backing store and context needed to draw using OpenGL ES (iOS) or OpenGL (OS X). |
CAReplicatorLayer |
Used when you want to make copies of one or more sublayers automatically. The replicator makes the copies for you and uses the properties you specify to alter the appearance or attributes of the copies. |
CAScrollLayer |
Used to manage a large scrollable area composed of multiple sublayers. |
CAShapeLayer |
Used to draw a cubic Bezier spline. Shape layers are advantageous for drawing path-based shapes because they always result in a crisp path, as opposed to a path you draw into a layer’s backing store, which would not look as good when scaled. However, the crisp results do involve rendering the shape on the main thread and caching the results. |
CATextLayer |
Used to render a plain or attributed string of text. |
CATiledLayer |
Used to manage a large image that can be divided into smaller tiles and rendered individually with support for zooming in and out of the content. |
CATransformLayer |
Used to render a true 3D layer hierarchy, rather than the flattened layer hierarchy implemented by other layer classes. |
QCCompositionLayer |
Used to render a Quartz Composer composition. (OS X only) |
//http://www.baisoujs.com/list_wp7_wp7article.html
- CAAnimationGroup *animGroup = [CAAnimationGroup animation];
- animGroup.animations = [NSArray arrayWithObjects:moveAnim,scaleAnim,opacityAnim, nil];
- animGroup.duration = 1;
- [view.layer addAnimation:animGroup forKey:nil];
更多详情请参考原文:http://www.baisoujs.com/detail_137290948705248.html