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

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容