您的位置:首页 > 移动开发 > IOS开发

ios 动画CoreAnimation中遇到的问题

2013-07-05 10:53 253 查看
刚接触CoreAnimation来做动画,发现动画做完了,又回退到初始状态,查了一下文档:发现如下字段,谨以为戒:

CABasicAnimation* move = [CABasicAnimation
animationWithKeyPath:@"position.x"];
move.fillMode=kCAFillModeForwards;
move.removedOnCompletion=NO;

1.

Determines if the animation is removed from the target layer’s animations upon completion.
@property(getter=isRemovedOnCompletion) BOOL removedOnCompletion
Discussion
When YES, the animation is removed from the target layer’s animations once its active duration has passed. Defaults to
YES.

2.

These constants determine how the timed object behaves once its active duration has completed. They are used with the
fillMode property.
NSString * const kCAFillModeRemoved;
NSString * const kCAFillModeForwards;
NSString * const kCAFillModeBackwards;
NSString * const kCAFillModeBoth;
NSString * const kCAFillModeFrozen;
Constants
kCAFillModeRemoved
The receiver is removed from the presentation when the animation is completed.
Available in iOS 2.0 and later.
Declared in CAMediaTiming.h.
kCAFillModeForwards
The receiver remains visible in its final state when the animation is completed.
Available in iOS 2.0 and later.
Declared in CAMediaTiming.h.
kCAFillModeBackwards
The receiver clamps values before zero to zero when the animation is completed.
Available in iOS 2.0 and later.
Declared in CAMediaTiming.h.
kCAFillModeBoth
The receiver clamps values at both ends of the object’s time space
Available in iOS 2.0 and later.
Declared in CAMediaTiming.h.
kCAFillModeFrozen
The mode was deprecated before OS X v10.5 shipped.
Available in iOS 2.0 and later.
Declared in CAMediaTiming.h.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: