Codes sind wie folgt:Ich setze den toValue der Rotation auf 2 * PI, aber warum sind diese Ansichten nach der Animation nicht horizontal?
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;
und die Wirkung: effect
Vor der Animation die Ansichten alle horizontal sind. Ich füge eine Rotationsanimation zu diesen Ansichten hinzu, und der toValue der Rotation ist 2 * PI. Warum sind sie nach der Animation nicht horizontal? Vielen Dank im Voraus !!
Was ist das Problem? Der gepostete Effekt wird erwartet oder wie es jetzt aussieht! Willst du damit sagen, dass die Ansichten nach der Animation auf ihre ursprüngliche Position zurückgehen? Wenn das der Fall ist, benutze removeOnCompletion –
Ich habe nicht abgestimmt Ihre Frage –
@SandeepBhandari Vor der Animation sind die Ansichten alle horizontal. Ich füge eine Rotationsanimation zu diesen Ansichten hinzu, und der toValue der Rotation ist 2 * PI. Warum sind sie nach der Animation nicht horizontal? – LeeG4ng