-1
コードは次のとおりです。回転のtoValueを2 * PIに設定しましたが、アニメーションの後にこれらのビューが水平でないのはなぜですか?
CABasicAnimation *rotateWhenBoom = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotateWhenBoom.fromValue = @0;
rotateWhenBoom.toValue = @(M_PI*2.0);
rotateWhenBoom.duration = 0.3f;
rotateWhenBoom.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
CAAnimationGroup *boom = [CAAnimationGroup animation];
boom.animations = @[[self moveOutWithBtn:btn], rotateWhenBoom];
boom.fillMode = kCAFillModeForwards;
boom.removedOnCompletion = NO;
そして効果: effect
ビューはすべて水平にアニメーションする前に。これらのビューに回転アニメーションを追加し、回転のtoValueは2 * PIです。アニメーションの後、なぜ水平でないのですか? ありがとうございます!コードの
いただきました問題?投稿された効果は期待されていますか、それとも今見えますか?あなたは、アニメーションの後の元の位置にビューが戻ると言っていますか?それはケースを使用している場合removedOnCompletion –
私はあなたの質問に投票しました。 –
@SandeepBhandariアニメーションの前に、ビューはすべて水平です。これらのビューに回転アニメーションを追加し、回転のtoValueは2 * PIです。アニメーションの後、なぜ水平でないのですか? – LeeG4ng