Re: How to center a custom NSView in a NSScrollView
Re: How to center a custom NSView in a NSScrollView
- Subject: Re: How to center a custom NSView in a NSScrollView
- From: Andrew Farmer <email@hidden>
- Date: Tue, 24 Feb 2009 14:34:40 -0800
On 24 Feb 09, at 13:46, Meik Schuetz wrote:
If the visible area (NSScrollView) is GREATER than the fixed size of
the custom NSView, the custom NSView should be positioned centered
in the NSScrollView, otherwise, the default behaviour of the scroll
view should apply. I just want to avoid that the custom NSView stays
at the bottom left (or top left) corner of the NSScrollView, when
there's enough space to center it horizontally and vertically.
The "corner-pinning" behavior you're seeing exists in NSClipView
(which is a component of scroll views). To override it, you'll need to
create a subclass of NSClipView - <http://www.bergdesign.com/missing_cocoa_docs/nsclipview.html
> has details on one approach.
_______________________________________________
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