Not alpha changing animation
Not alpha changing animation
- Subject: Not alpha changing animation
- From: Lukas Tenbrink <email@hidden>
- Date: Sun, 22 Aug 2010 19:14:47 +0200
Hello list,
I've tried to animate a view (aView) to fade in, and another view (self) should look like it's fading out, while using the animator of my view.
While The old view (self) stays visible in the background, the new one (aView) should slowly fade in until the old view (self) isn't visible anymore. Then it can be removed from the superview itself.
Here's my try:
[aView setAlphaValue:0];
[[[self window] contentView] addSubview:aView];
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:0.3];
[[aView animator] setAlphaValue:1];
[self performSelector:@selector(removeFromSuperview) withObject:self afterDelay:[[NSAnimationContext currentContext] duration]];
[NSAnimationContext endGrouping];
But it doesn't animate. The old view (self) stays as a subview of the contentView for 0.3 seconds, then removes itself. So this works fine. But aView doesn't animate, it just appears like it's alpha value always stays at 1, and the first line of code was never executed, though I know it is.
I hope this is enough information. Thanks in advance for your help!
_______________________________________________
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