I have a CAKeyframeAnimation of a sprite sheet's contentsRects property to show an animation in a CALayer. Everything works most of the time, but occasionally I see a wrong part of sprite sheet for a one frame. CAKeyframeAnimation is set to discrete mode and all the coordinates are checked. Seems to me that once in a while CAKeyframeAnimation misses a keyframe and shows me just a center piece of my sprite sheet instead of a piece that it suppose to cut out based 开发者_JAVA技巧on provided array of contensRects. How to fix the above? Also on the same topic how to debug CAKeyframeAnimation in general and find out what's going on?
thanks!
to fix it I've wrapped my animation in CATransaction and temporarily disabled all layer actions:
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; // we need to disable all layer actions temporarily
.............. the rest of animation code ...............
[CATransaction commit];
thank you Apple's documentation!
精彩评论