• 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 and autolayout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScrollView and autolayout


  • Subject: NSScrollView and autolayout
  • From: Chuck Soper <email@hidden>
  • Date: Tue, 26 Feb 2013 14:32:16 -0800
  • Thread-topic: NSScrollView and autolayout

Does NSScrollView own its documentView, and controls the value that
documentView returns for setTranslatesAutoresizingMaskIntoConstraints:?

I've created an NSView subclass that I'm using for a documentView within
an NSScrollView. I'm calling [self
setTranslatesAutoresizingMaskIntoConstraints:NO] during initialization. Is
that a problem? The UI works fine, but the layout for my documentView is
ambiguous. I believe that I'm setting its constraints properly.

Would it be better to [scrollView.documentView
addSubview:myContainerView]? Then, add the following constraints to the
scrollView.documentView:
 @"V:|[myContainerView]|" and @"H:|[myContainerView]|"
This way, I think that it would be fine to call [self
setTranslatesAutoresizingMaskIntoConstraints:NO] during initialization for
myContainerView.

If this is true, then I think that I may need to call setFrameSize: on
scrollView.documentView when my myContainerView frame size changes, is
that correct? Or, is there some way to get my documentView to resize based
on its subviews (i.e. myContainerView)?

With NSSplitView, I think it's fine to add subviews that use auto layout.

Any help would be appreciated.
Thanks,
Chuck


_______________________________________________

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 and autolayout
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: NSTrackingInVisibleRect not working when view is resized
  • Next by Date: Re: archiving report
  • Previous by thread: Re: NSTrackingInVisibleRect not working when view is resized
  • Next by thread: Re: NSScrollView and autolayout
  • Index(es):
    • Date
    • Thread