1

私はコア アニメーションの初心者で、ビューを 3D で順番にアニメーション化しようとしています。ただし、2 番目のアニメーションで問題が発生しています。基本的に、ビューが回転して特定のポイントに移動すると、別の移動が行われます。

実行すると動作しているように見えますが、2 番目のアニメーションはビューを移動先に移動しますが、最初の位置に戻ります! これは、まるで第 3 のファントム アニメーションがたまたまビューを初期状態に戻すかのようです。

なぜこれが起こっているのか、どうすれば修正できるのかを誰かが説明できますか? ありがとうございました!

CATransform3D translation = CATransform3DMakeTranslation(0.0, -50.0, 0.0);
translation.m34 = 1.0 / -500.0f;
CATransform3D finalTransform = CATransform3DRotate(translation, 90.0f, 1.0, 0.0, 0.0);
[UIView animateWithDuration:2.0f animations:^{
    [viewImageScroll.layer setTransform:finalTransform];
} completion:^(BOOL finished) {
    CATransform3D flyAway = CATransform3DMakeTranslation(0., 0., -10000);
    [UIView animateWithDuration:3.0f animations:^{
        NSLog(@"done");
        [viewImageScroll.layer setTransform:flyAway];
    } completion:^(BOOL finished) {
        NSLog(@"done and done");
    }];
}];
4

0 に答える 0