Quartz、Core Animation、UIKit

有点儿迷:http://www.cnblogs.com/pengyingh/articles/2482408.html

博客园:http://www.cnblogs.com/mjios/




Core Animation :


Core Animation是直接作用在CALayer上的,并非UIView.

一.使用步骤

http://www.cnblogs.com/mjios/archive/2013/04/15/3021039.html


能用的动画类只有四个




具体:

CAAnimation:继承NSObject,实现的代理有NSCoding,NSCopying,CAMediaTiming,CAAction

类方法:

//创建一个新的动画对象

+ (instancetype)animation;

//Animations implement the same property model as defined by CALayer.See CALayer.h for more details.

+ (nullable id)defaultValueForKey:(NSString *)key;

方法:

- (BOOL)shouldArchiveValueForKey:(NSString *)key;

属性:

动画切入方式 timingFunction

Delegate:

- (void)animationDidStart:(CAAnimation *)anim;

- (void)animationDidStop:(CAAnimation *)anim;

CAAnimation's SubClass:    CAPropertyAnimation

类方法:

//Creates a new animation object with its 'keyPath' property set to 'path'

+ (instancetype)animationWithKeyPath:(nullable NSString *)path;

属性:

动画描述:keyPath

设置动画:CAValueFunction * valueFunction

CAPropertyAnimation's SubClass:    CABasicAnimation

@property(nullable,strong)idfromValue;

@property(nullable,strong)idtoValue;

@property(nullable,strong)idbyValue;

CAPropertyAnimation's subClass CAPropertyAnimation

属性太多看官方文档吧.



重要!!!!

animationWithKeyPath的值: 列表https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/Key-ValueCodingExtensions/Key-ValueCodingExtensions.html


transform.scale = 比例转换

transform.scale.x = 宽的比例转换

transform.scale.y = 高的比例转换

transform.rotation = 旋转

transform.rotation.z = 平面圆的旋转

opacity = 透明度

margin = 边距

zPosition

backgroundColor = 背景色

cornerRadius = 圆角

borderWidth

bounds

contents

contentsRect

frame

hidden

mask

masksToBounds

opacity

position = 位置

shadowColor

shadowOffset

shadowOpacity

shadowRadius

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容