简体   繁体   中英

Image sequence animation with Core Animation

I'm currently using a UIImageView with an array of images to create a small looping animation sequence with about 20 images in there (at 320x480). Whilst this works okay for 20 - 30 images, any more and the app quits on the iphone. There is nothing else in my test app at the moment so I know it's just down to the animationImages sequence.

Has anyone come across any samples of doing this type of thing through Core Animation to achieve better performance and allow many more images? From what I've read it sounds like its possible to set up a ton of CALayers and put an image in each, and then create the animation by manipulating the layers on and off in sequence. Is this a good way to do it?

Or, alternatively, as I'm basically after the effect of a looping movie, is there a way to use the moviecontroller to achieve the effect without it fading in and out at the start and at the end?

I'd be grateful for any pointers. Many thanks.

This could be a simple memory issue. 20 images (320x480) is about 3 MB of memory, assuming 8bpp (if they're higher color, obviously even more). You might try loading and unloading as needed (though, of course, that'll mean rolling your own animation, rather than using UIImageView).

Sounds like a simple memory issue.

You could load one or two frames at a time, or actually play a movie instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM