New CATransform3DMakeRotation deletes old transformation?!

Posted by david on Stack Overflow See other posts from Stack Overflow or by david
Published on 2010-05-25T10:54:02Z Indexed on 2010/05/25 12:41 UTC
Read the original article Hit count: 399

I added a CATransform3DMakeRotation to a layer. When I add another one it deletes the old one?

The first one:

[UIView beginAnimations:@"rotaty" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self]; 
CGAffineTransform transform = CGAffineTransformMakeRotation(-3.14);
kuvert.transform = CGAffineTransformRotate(transform, DegreesToRadians(134));
kuvert.center = CGPointMake(kuvert.center.x-70, kuvert.center.y+100);
[UIView commitAnimations];

and the second one:

CABasicAnimation *topAnim = [CABasicAnimation animationWithKeyPath:@"transform"];
topAnim.duration=1;
topAnim.repeatCount=0;
topAnim.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(0.0, 0, 0, 0)];
float f = DegreesToRadians(180);  // -M_PI/1;
topAnim.toValue=[NSValue valueWithCATransform3D:CATransform3DMakeRotation(f, 0,1, 0)];
topAnim.delegate = self;
topAnim.removedOnCompletion = NO;
topAnim.fillMode = kCAFillModeBoth;
[topAnim setValue:@"flippy" forKey:@"AnimationName"];
[[KuvertLasche layer] addAnimation:topAnim forKey:@"flippy"];

The second one resets the view and applies itself after that. How do I fix this??

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiview