有點兒迷: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,實現(xiàn)的代理有NSCoding,NSCopying,CAMediaTiming,CAAction
類方法:
//創(chuàng)建一個新的動畫對象
+ (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
設(shè)置動畫: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 = 比例轉(zhuǎn)換
transform.scale.x = 寬的比例轉(zhuǎn)換
transform.scale.y = 高的比例轉(zhuǎn)換
transform.rotation = 旋轉(zhuǎn)
transform.rotation.z = 平面圓的旋轉(zhuǎn)
opacity = 透明度
margin = 邊距
zPosition
backgroundColor = 背景色
cornerRadius = 圓角
borderWidth
bounds
contents
contentsRect
frame
hidden
mask
masksToBounds
opacity
position = 位置
shadowColor
shadowOffset
shadowOpacity
shadowRadius