有没有办法设置 CABasicAnimation 的动画步数?
我想创建一个插入某些属性 2 秒的动画,并且 CoreAnimation 框架只需生成 20 帧(表示层)。我知道如何提供显式动画的持续时间,但是我必须更改哪个属性才能获得通过插值过程计算的特定帧数?
提前致谢。
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 CoreAnimation 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
核心动画通过使用插值来工作——计算您指定的键值之间的中间值。如果它是关键帧动画,它会在值数组中的数值 (n) 之间进行插值。如果它是基本动画,它会在两个值(开始值和结束值)之间进行插值。如果您只想更改动画实例的帧速率,请通过此 如何更改核心动画实例的帧速率?
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?
你想要的东西用 Core Animation 是不可能实现的。它绘制图层的次数取决于程序的帧速率。
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.