1

(デリゲート) でanimationDidStartCABasicAnimationを更新したいCATextLayer。ただし、ユーザーが画面に触れた場合、実行中のすべてのアニメーションを削除したいと思います[self.maskLayer removeAllAnimations];(すべてのアニメーションが順番に再生されます)。

ただし、removeAllAnimations何らかの理由でanimationDidStartANDanimationDidStopがまだ呼び出された後、アニメーション自体は表示されません。これは明らかに私が望んでいるものではありません。

アニメーションは次のように追加されます。

- (void)addAnimations {

for (int i=1; i<6; i++) {
NSString* intValue = [NSString stringWithFormat:@"%d", i];

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"];

animation.duration = 0.5;

animation.delegate = self;

animation.repeatCount = 0;

animation.autoreverses = NO;

[animation setValue:intValue forKey:@"animationString"];

animation.timingFunction = nil;

[animation setRemovedOnCompletion:NO];

[animation setFillMode:kCAFillModeForwards];

animation.fromValue = (id) [self getCGRectForZoomLevel:i];

animation.toValue = (id) [self getCGRectForZoomLevel:i + 1 ];

animation.beginTime = CACurrentMediaTime() + i * 2;

[self.shapeLayer addAnimation:animation forKey:intValue];
}
}

これを防ぐ方法は?この問題には今までに数時間かかりました:(

ありがとう!

4

0 に答える 0