UIImageView animations lag at first run

那年仲夏 提交于 2019-12-23 12:16:35

问题


I have a series of images that play in my application (it's only got one view/viewcontroller). Whenever I run the app, the first time I play an animation, it will lag a bit the first time the animation is told to play.

I run my animations via different methods (e.g. "animateJump") which are responsible for loading the correct frames, then playing the animation. After the animation finishes, I (supposedly) release the animation from the UIImageView, putting back a single frame to display. (I say supposedly because if the animations are only lagging the first time they run, are they really being release from memory?)

So is there a simple fix to this? I have about 100 frames of animation I go back and forth through. Should I just load them all into memory at the application's start up? What would you do?

-- Derek


回答1:


If you've already got a period of loading, I"d probably use it to run the animation whilst it's hidden/non-viewable.



来源:https://stackoverflow.com/questions/3382478/uiimageview-animations-lag-at-first-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!