Re: [[NSView animator] setHidden:YES] doesn't fade?
Re: [[NSView animator] setHidden:YES] doesn't fade?
- Subject: Re: [[NSView animator] setHidden:YES] doesn't fade?
- From: Bill Dudney <email@hidden>
- Date: Wed, 23 Jan 2008 07:15:02 -0700
Hi Philip,
As others have suggested if you turn on layer backing ([view
setWantsLayer:YES]) you can get the fade simply by removing the
subview from its superview.
i.e.
- (void)removeView:(id)sender {
// myView is layer backed
NSView *removedView = [[myView subviews] objectAtIndex:0]; // just
for illustration, find removedView however it makes sense for your code
[[removedView animator] removeFromSuperview];
}
As long as removedView's superview is layerbacked it will get the
default animation (fade).
HTH,
-bd-
http://bill.dudney.net/roller/objc
On Jan 22, 2008, at 6:06 PM, Philip Dow wrote:
Hi all,
I'm looking to fade a view on Leopard. I'm using the animator to
successfully move the view by changing its frame, but calling
setHidden on it does not seem to fade it -- behavior I would expect.
Is this the right way to fade a view, or is fading not a built-in
animation?
I'm calling the method inside an NSAnimationContext grouping, and
all the other animations in that grouping work.
~Phil
_______________________________________________
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
_______________________________________________
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