Re: Window Resize with Animator Proxy: Window Contents Jump Around
Re: Window Resize with Animator Proxy: Window Contents Jump Around
- Subject: Re: Window Resize with Animator Proxy: Window Contents Jump Around
- From: Peter N Lewis <email@hidden>
- Date: Tue, 14 Jul 2009 10:37:33 +0800
On 13/07/2009, at 19:08 , Marc Liyanage wrote:
I am trying to resize a window with an animation using the
NSAnimatablePropertyContainer animator proxy mechanism. The views
have the "Wants CA Layer" option set in IB.
Its ridiculously painful isn't it?
One thing that may trip you up is auto resizing. Consider disabling
it or making sure it is behaving properly.
Also, I've found generally that using custom flipped views works
better. this gives a top left co-ordinate system and avoids a lot of
jittering.
@implementation FlippedView
- (BOOL)isFlipped
{
return YES;
}
- (void)awakeFromNib;
{
for ( NSView *v in self.subviews ) {
NSRect frame = v.frame;
frame.origin.y = NSMaxY(self.bounds) - NSMaxY(frame);
v.frame = frame;
v.autoresizingMask = v.autoresizingMask ^ (NSViewMinYMargin|
NSViewMaxYMargin);
}
}
@end
Further, I never got layer backing to work properly if there are any
scroll bars involved, and there are probably other cases that simply
didn't work well (at least in Leopard).
It also works if I don’t enable the CA layer backing in IB, but I
need that because I am going to fade a subview at the same time as I
resize the window. Without CA layers I can only hide and show the
subview with a hard transition, but I want to fade it.
Check out MGViewAnimation from Matt Gemmell <http://mattgemmell.com/2006/11/13/mgviewanimation
>. I use a heavily hacked version for the next version of Keyboard
Maestro to get animating/fading views and it works quite well.
Enjoy,
Peter.
--
Clipboard Switching and Macros with Keyboard Maestro
Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/> <http://download.stairways.com/>
_______________________________________________
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