How to keep a subview centered - autoresizing
How to keep a subview centered - autoresizing
- Subject: How to keep a subview centered - autoresizing
- From: Dan Bernstein <email@hidden>
- Date: Fri, 8 Feb 2002 17:16:49 +0200
I have a view which is initially centered in its superview (which is an
NSWindow's contentView) with its autoresizingMask set to
NSViewMinXMargin | NSViewMinXMargin (i.e. springs to the left and to the
right). When the user drags the window wider, the initially-centered
view starts drifting to the left (apparently if the resize amount is
odd, then the extra pixel is always added to the right margin). What's
the Right Thing to Do if I want the view to remain centered at all
times? I suppose I can call -[NSWindow setResizeIncrements:] with even
increments. Any better ideas?
TIA,
-- Dan Bernstein
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.