Re: ambiguous layout for documentView in NSScrollView
Re: ambiguous layout for documentView in NSScrollView
- Subject: Re: ambiguous layout for documentView in NSScrollView
- From: Kyle Sluder <email@hidden>
- Date: Sun, 17 Mar 2013 09:50:51 -0700
On Mar 17, 2013, at 9:37 AM, Kyle Sluder <email@hidden> wrote:
>
> So that we're all on the same page: your internal vertical constraints can be expressed as @"V:|[subview1(>=70)][subview2(>=70)]…|". Then you add a constraint of @"|[documentView]|" to your scroll view.
Follow-up: if your goal here is to stretch your documentView to fill the viewport, you cannot use a pinning constraint, or else you will eventually encounter a constraint violation exception as I mentioned before. Instead, your documentView must observe the clip view's frame-changed notifications and install/update a constant-height constraint on itself.
Note that this will have to be an equality constraint, rather than a greater-than-or-equal-to constraint, or else any height greater than your constraint's constant is valid and you will wind up with ambiguous layout. Therefore you must choose a priority for this constraint while considering the content hugging and compression priorities of your contents—or consciously decide to override them.
--Kyle Sluder
_______________________________________________
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