As Glenn indicated, this is largely a factor of the size of the images. Layers are considerably lighter weight than Views (with the associated functionality loss). Of course, doing what you want to do - depending on the animation involved - might simply be having two image views and animating between then while changing their image backings (UIImageView is the presentation layer for a UIImage and so it is generally most appropriate to have only the max number of UIImageViews that you need to display at once in memory). Of course, if you absolutely need 20 images on screen at once to do something like the apple tv screensaver, I'd advise looking at layers as you may not always be able to control the size of the images.

-rob.

On Jan 11, 2009, at 12:04 PM, Glenn Bloom wrote:

I don't think I see this issue in my own code using UIImageView with a like number of JPEG's. How large are yours? For a variety of reasons, I have found that optimizing mine as 150KB or less each is acceptable for 480 * 320 pixel images. On the other hand, while speed appears fine (and I can easily speed it up or slow it down by setting duration), I am just eyeballing it to confirm that there are no skipped frames - my next step should be to use Instruments to confirm this - I believe there is a Instrument that supports
doing this as well.
Message: 3
Date: Sat, 10 Jan 2009 12:01:46 -0800
From: Alex Strand <mrstr...@gmail.com>
Subject: Using UIImageView for animations
To: cocoa-dev@lists.apple.com
Message-ID: <a5616f0f-d4f4-4611-901e-39f89b6b7...@gmail.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Hi!

I'm taking a set of 10-20 jpegs that I'd like to animate.  I started
out just using a UIImageView using setAnimationImages: and everything
worked fantastically in the simulator but testing it on my device
basically makes it slow to the point where it is unresponsive.  I've
done some searching around and some people indicate that they are able
to use CALayers to get this same effect but before going down that
path I thought I would ask you folks.

What is the best way of doing this?

Alex
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to