ios 动画CoreAnimation中遇到的问题

刚接触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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值