Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?
Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?
- Subject: Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?
- From: WT <email@hidden>
- Date: Fri, 3 Apr 2009 05:11:51 +0200
25 was just a test. The actual app has 2 interlocking 7x7 grids, so
the number of image views is actually 98. I should explain that this
animated laying out of image views happens only once and, from that
point on, the image views all remain in the same place, though each
image itself is animated. Here's a screen shot to clarify things:
The balls pulsate, growing and shrinking in size, an effect that I
accomplish using UIImageView's -startAnimating, but the animation I
was referring to in my previous posts has to do with adding each image
view to its proper place.
My question boils down to this: if I am going to use -startAnimating
for the pulsation, then each ball *has* to be an instance of
UIImageView, which requires me to add 98 subviews to the superview and
the laying out animation is as I described in the 25-image example. On
the other hand, I could forgo using 98 subviews and do everything (one-
time animated layout *and* animated pulsation) inside the superview's -
drawRect. This second option is where I'm unsure how to proceed.
The solution I have now (98 subviews) works and is convenient but is
taxing the device, so I'm looking for a better alternative,
performance-wise.
Thanks for any help.
Wagner
On Apr 2, 2009, at 7:31 PM, James Montgomerie wrote:
25 image views seems a /little/ on the high side (probably not
enough to cause major worry), but other than that it seems like a
perfectly good approach.
If you haven't already, and it's something that possible, you might
want to consider what to do (i.e. should you try to stop the timer)
if the user navigates away from your view before your subviews are
all added.
Jamie.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden