• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to center a custom NSView in a NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: How to center a custom NSView in a NSScrollView (From: Meik Schuetz <email@hidden>)

  • Prev by Date: Re: Drawing a badge in an OutlineView column cell: but width changes on expanding
  • Next by Date: Re: [Q] What causes an NSArrayController to know that an entity was inserted via a different window?
  • Previous by thread: Re: How to center a custom NSView in a NSScrollView
  • Next by thread: Re: How to center a custom NSView in a NSScrollView
  • Index(es):
    • Date
    • Thread