美文网首页
Quartz、Core Animation、UIKit

Quartz、Core Animation、UIKit

作者: OnepPieceD | 来源:发表于2016-06-20 15:46 被阅读83次

有点儿迷: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

相关文章

网友评论

      本文标题:Quartz、Core Animation、UIKit

      本文链接:https://www.haomeiwen.com/subject/qieclttx.html