I believe this is where the constraint priorities come in. The window size will be affected by constraints with priorities larger than 500 and may override constraints under 500. Also, when dealing with ScrollViews it can get a bit tricky, so it helps to add a single view inside the scrollView which you can apply constraints against and then add your contents to that view.
In this case you would add an inequality constraint between that view in the scrollView and the window’s main view (i.e. the window width must be less-than-or-equal to the scrollView’s content plus some constant). You might need to write that programmatically (as opposed to in IB). (Note: This is off the top of my head, haven’t gotten a chance to test it) Thanks, Jon > On May 24, 2015, at 10:00 PM, Rick Mann <[email protected]> wrote: > > I have a bunch of views statically arranged inside an NSScrollView. Their > relative size doesn't change. But it's a large view, and I want to be able to > view it on smaller displays, hence the scroll view. > > Is there a way to constrain the window size to never be larger than just big > enough to disable to scroll bars using autolayout constraints? > > -- > Rick Mann > [email protected] > > > > _______________________________________________ > > Cocoa-dev mailing list ([email protected]) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/jhull%40gbis.com > > This email sent to [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
