Re: Custom view in NSScrollView in IB
Re: Custom view in NSScrollView in IB
- Subject: Re: Custom view in NSScrollView in IB
- From: Kyle Sluder <email@hidden>
- Date: Tue, 19 Mar 2013 22:48:30 -0700
On Mar 19, 2013, at 10:32 PM, Rick Mann <email@hidden> wrote:
> Hi. I've embedded my custom view in an NSScrollView, but I can't get IB to resize the custom view's frame when I resize the scroll view. I just want it to match while repositioning the view as I evolve my UI.
This is because IB incorrectly omits the autoresizing mask controls when auto layout is enabled in the nib, even if translatesAutoresizingMaskIntoCnstraints is turned on for the view. Please file a bug on this; it will probably be duped to mine.
>
> Also, it doesn't let me create autolayout constraints for it.
As implied above, translatesAutoresizingMaskIntoConstraints is on for your document view. This is because NSClipView expects this to be the case. See my recent discussion with Chuck Soper on this list for a technique to integrate auto layout with NSScrollView.
Attempting to use constraints directly on your document view will lead to unsatisfiable constraint exceptions, ambiguous layout, or both.
--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