ios - UIimage animation certain amount -


I am creating an app on an iOS device and it will have an animation on the background but basically I do not want to see how many images you have Animation can upload here to the code I have installed

h

  #import & Lt; UIKit / UIKit.h & gt; @ Interface View Controller: UIViewController {IBOutlet UIImageView * Animation; } @end   

m

  #import ViewController @interface "ViewController.h" () @end @implementation ViewController - (void) viewDidLoad {animation. Animsnimages = [Nsrray Arryvitobjekts [Uiimage Imagenmed: @ "Animtedbglkgif"], [Uiimage Imagenmed: @ "Animtedbg2kgif"], [Uiimage Imagenmed: @ "Animtedbg3kgif"], [Uiimage Imagenmed: @ "Animtedbg4. GIF "], [Uiimage Imagenmed: @" Animtedbg5kgif "], [Uiimage Imagenmed: @" Animtedbg6kgif "], [Uiimage Imagenmed: @" Animtedbg7kgif "], [Uiimage Imagenmed: @" Animtedbg8kgif " ], [UIImage imageNamed: @ "Animated BG. Gif"], Zero], [Animation Set Animation Recurrence Number: 0]; Animation. Animation period = 2; [Turn on animation]; }   

I currently have 9 images but for my animation, I get 155 images so that still work can be done. If you do not know that I can take better route?

I do not think there is a firm limit on which you will have to face. However, if you use too many images, then you can run in the memory limit, how big is each image uncompressed? It affects a lot.

Of course, you probably know that there is no guaranteed amount of memory available for third-party iOS apps and depending on the system, how many web pages user is running in mobile safari, etc. There will be various amounts of free memory available.

You may need it and the creation of the experiment.

Just one point of reference I had an app that was using animation image , and the images were not quite full screen (480 x 270 pixels). Images were 24-bit PNG, each about 70KB compressed.

I found that I can safely use about 10 of them safely, and there is no need to worry too much about closing to control less memory conditions. Now, at that time, I was targeting iPhone 3G , which is now quite old. However, you may still want to support the iPhone 3G model.

You can, of course, try to load your image and how many images you can try to load, if you want something more generic, the new iOS device is released. Can not break, you can, again, you can codify your app to load only-number pictures if you think that you are running on a device with low memory.

You can also apply didReiveiveMemoryWarning in your code UIViewControllers, and when you choose to unload some images do get memory warnings I assumes all its animation such The removal of that images just makes the animation look less smooth, and it is not completely non-functional.



Comments