On Sep 2, 2010, at 5:11 PM, Christian Ziegler wrote:

> I could use your help because I'm running out of ideas!
> 
> Here's the situation. I got this custom view on screen which I want to remove 
> from the screen by moving it outside the left border of the screen. However 
> at the same time, I want to move it back in from the right side but at a 
> different y-Coordinate. So for instance it moves out at y=44 and at the same 
> time it moves back in from the other side at y=0. 
> 
> I tried several approaches and the most promising (I reckon) is to create a 
> copy of the view. This is not so easy though because UIView does not 
> implement NSCopying. My custom view also has subviews and well the animation 
> apparently gets a little confused if you animate two different (equal but 
> different object) views which share the same subviews.
> 
> Has anybody the slightest idea how I could achieve this? Every tip is welcome 
> :)!

Capture the view you want to animate into a UIImage.  Add two image views with 
that image to the view hierarchy.  One will be directly over your original view 
and the other will offscreen to the right.

Hide your original view.  Then, animate both image views as needed.  When 
animation ends, unhide the original view, then remove both image views.

Other notes...

You may want to ensure that when your original view is hidden, its container 
view has say a black background (or whatever background you want during the 
animation).

Note that by taking static images of your original view, no animations on that 
view itself will run during the overall animation.  Probably a good thing 
though.

___________________________________________________________
Ricky A. Sharp         mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

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