• 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
NSScrollView, centering document view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScrollView, centering document view?


  • Subject: NSScrollView, centering document view?
  • From: Todd Heberlein <email@hidden>
  • Date: Sat, 29 Jan 2011 21:38:15 -0800

When working with an NSScrollView, sometimes my document view is smaller than my content/clip view. (the document view's size is dynamically generated depending on the data that needs to be rendered; or the user may make the window much larger than the document view.)  In these cases I would like to have my document view centered inside the clip view (as opposed to being anchored in the lower-left corner as it currently is. I tried changing the document view's frame's origin, but this didn't appear to have any effect.

Is there an easy way to do this? Or should I make sure my document view is always at least as large as the content view and then just center my drawing inside my document view?

Thanks,

Todd

_______________________________________________

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

  • Follow-Ups:
    • Re: NSScrollView, centering document view?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: (id) issue, passing different types during initWith:(id)type
  • Next by Date: Re: NSScrollView, centering document view?
  • Previous by thread: Re: (id) issue, passing different types during initWith:(id)type
  • Next by thread: Re: NSScrollView, centering document view?
  • Index(es):
    • Date
    • Thread