How to transform (rotate) a already exist CALayer/animation?
Posted
by Flocked
on Stack Overflow
See other posts from Stack Overflow
or by Flocked
Published on 2010-03-31T02:53:29Z
Indexed on
2010/04/01
7:43 UTC
Read the original article
Hit count: 312
Hello, I have added a CALayer to the UIView of my app:
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.58;
[animation setRemovedOnCompletion:NO];
[[self.view layer] addAnimation:animation forKey:@"pageCurlAnimation"];
Now when the user rotates the device, the layer always stays in the same position on the screen (in line to the homescreen button). Is it possible to rotate the animation/layer? I tried
self.view.layer.transform = CGAffineTransformMakeRotation (angle);
but this code just rotates the UIView and not the animation/layer I set.
© Stack Overflow or respective owner