Re: animating addSubview with iOS4
Re: animating addSubview with iOS4
- Subject: Re: animating addSubview with iOS4
- From: Matt Neuburg <email@hidden>
- Date: Sat, 05 Mar 2011 10:27:43 -0800
On Fri, 04 Mar 2011 14:30:12 +0100, Andreas Grosam <email@hidden> said:
>So it seems, there is a problem performing UIViewAnimationOptionTransition... animations for the UIView transitionWithView:... class method, and possibly for transitionFromView:... invoked from -viewWillAppear: and viewDidAppear:.
My first thought is to wonder whether this is related to the problem I often see where the *first* curl animation I ask for in an app is often not performed, no matter how or when it's triggered. I have tried to work around this by "priming the pump" (performing some harmless animation that wakes up the animation world) but not with any great degree of success.
For example, my Zotz! app deals cards like this:
- (void) setCardWithAnimation: (Card*) newCard {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration: 0.35];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self cache:YES];
self.card = newCard;
[self setNeedsDisplay];
[UIView commitAnimations];
}
In a completely new game from a cold start, this doesn't work reliably for the *first* trio of replacement cards. All three replacement cards just appear, bang, without any animation. But this is not at the start of the game; the app has been running for some time, and there have been other animations that have appeared correctly. So perhaps it's no coincidence that this example has to do with a curl animation, and perhaps what you're observing is this, and has nothing to do with viewDidAppear: per se.
m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
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