I draw some GIS data dynamically, based on user's control, into CGImageRef. But how to play these frame like an animation efficiently in an UIImageView?
After searching and surveying, the way to play an animation in UIImageView is preloading all images you need,and invoking the startanimating method,like this:
myImageView.animationimages=[NSArray arrayWithObjects:1uiimage,2uiimage,....,nil]; [myImageView startAnimating];
But the waiting time is too long if i preload all UIImages, because i have more than 400 frames each time.
I want to play the animation like a stream,real time stream, how开发者_如何学Go to do that? Deeply appreciating if you could give me any idea or an example. :)
Use CADisplayLink to get notified on each screen refresh. Change myImageView.image in the callback.
(You might have to do something more clever if you want to limit the framerate.)
精彩评论