Ich habe den folgenden Code, der eine CALayer durch -45degrees auf der Y-Achse dreht:Mein CALayer verwandeln hält nach der Animation, aber die Perspektive verschwindet
#define D2R(x) (x * (M_PI/180.0))
- (void) swipe:(UISwipeGestureRecognizer *)recognizer
{
CATransform3D transform = CATransform3DMakeRotation(D2R(-45), 0, 1.0, 0);
transform.m34 = -1.0/850;
CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath: @"transform"];
transformAnimation.fillMode = kCAFillModeForwards;
transformAnimation.removedOnCompletion = NO;
transformAnimation.toValue = [NSValue valueWithCATransform3D:transform];
transformAnimation.duration = 0.5;
[self.layer addAnimation:transformAnimation forKey:@"transform"];
}
Die Animation funktioniert, außer es ohne Perspektive endet - zu ignorieren meine m34-Einstellung, wenn ich die Dinge richtig verstehe.
Auf halbem Weg durch:
Am Ende:
Was mache ich falsch?