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.
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.
相关文章推荐
- iOSCoreAnimation动画系列教程(一):CABasicAnimation【包会】
- iOSCoreAnimation动画系列教程
- iOS Core Animation(核心动画)
- iOS 之core Animation中的多种动画效果
- iOS Core Animation Advanced Techniques(四):隐式动画和显式动画
- iOS CoreAnimation专题——原理篇(四)动画时间控制
- iOSCoreAnimation动画系列教程(一):CABasicAnimation
- iOS CoreAnimation 转场动画 CATransition
- iOS开发基础知识:Core Animation(核心动画)
- iOS-Core-Animation之十一----基于定时器的动画
- iOSCoreAnimation动画系列教程(一):CABasicAnimation【包会】
- iOS核心动画之CoreAnimation
- iOS Core Animation Advanced Techniques(六): 基于定时器的动画和性能调优
- iOS CoreAnimation-粒子动画
- iOS动画之Core Animation
- iOS开发基础知识:Core Animation(核心动画)
- iOS开发之Core Animation动画
- iOS中动画实现技术主要是:Core Animation。
- iOS CoreAnimation专题——原理篇(二) UIView block动画实现原理
- iOS开发基础知识:Core Animation(核心动画)