I need to synchronize a path animation on two different layers (one is used as a mask for another layer, the other shows a graphical element that follows the path, i.e. draws the mask). If I just set them up identically, they never quite do the same thing. Currently, I am using a CAKeyframeAnimation with a path (for the graphical element) and a CABasicAnimation, where I animate "strokeEnd" of the same path from 0.0 to 1.0 (for the mask).
I guess an animation group does not work here, since that would mean I apply the group to the mask 开发者_运维技巧layer, which would hide the graphical element.
Have you set calculationMode = kCAAnimationPaced
for the keyframe animation?
Apple has informed me of a known bug in iOS7 where certain paths (such as elliptical paths) will not work well with respect to animating 2 different layers along the same path, e.g. strokeEnd of one layer, and position of another layer. Specifically, the 2 animations fall in and out of sync during the animation, and look sloppy. Apple also informed me there is no known workaround. I also filed a bug with Apple.
精彩评论