Is there a way to set the number of animation steps for CABasicAnimation?
I want to create an animation that interpolates some property for 2 seconds and only 20 frames (presentation layers) have to be generated by the C开发者_C百科oreAnimation framework. I know how to provide a duration for the explicit animation but which property do I have to change in order to get particular number of frames calculated by interpolation process?
Thanks in advance.
Core Animation works by using interpolation--calculating intermediate values in between key values you specify. If it's a keyframe animation, it interpolates between the number (n) of values in your values array. If it's a basic animation, it interpolates between two values--your start and end values. If you just want to change the frame rate of the animation instance go through this How to change the frame rate of a core animation instance?
What you want is not possible with Core Animation. The number of times it draws your layer is based off your program's frame rate.
精彩评论