CAAnimation stops when scrolled out of bounds
I have a custom activity indicator in the form of an infinitely rotating
UIImageView. And this this amazing activity indicator is placed inside a
table cell.
The animation is achieved this way:
CABasicAnimation* animation = [CABasicAnimation
animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat:0.0f];
animation.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
animation.duration = 1.0f;
animation.repeatCount = INFINITY;
[self.layer addAnimation:animation forKey:@"SpinAnimation"];
At first, it work beautifully... But when the cell gets scrolled off the
bounds of the table, the animation stops, and I have no idea how to reset
it... /:
Please help...
Thanks so much in advance... :)
No comments:
Post a Comment