Re: Why are these layout constraints being ignored?
Re: Why are these layout constraints being ignored?
- Subject: Re: Why are these layout constraints being ignored?
- From: Kyle Sluder <email@hidden>
- Date: Tue, 02 Jul 2013 09:43:10 -0700
On Jun 25, 2013, at 6:10 AM, Rob Nikander <email@hidden> wrote:
>
> I create 4 constraints with the desire to pin the NSOutlineView to the
> edges of it's superview (the NSWindow's contentView). It works, until I
> expand/collapse items in the outline view. Then the constraints are ignored
> and the outline shrinks. Why are they ignored? What is it in the outline
> view that is taking priority? It's intrinsicContentSize is (-1,-1) which I
> thought meant it could be stretched out to satisfy other constraints.
Long story short, NSOutlineView (and NSTableView) will do one of two behaviors when tiling:
1. Inside an NSClipView (which is the case when it is the document view of an NSScrollView), it will fill its clip view or its content, whichever is bigger.
2. Outside of an NSClipView, it will resize to hug its content as small as possible.
Obviously, neither of these is compatible with auto layout. There are no override hooks to customize this behavior. The only thing I have found that works reliably is to put the table view inside an NSClipView, and resize that appropriately.
Please file radars on the inflexibility of NSTableView. I know I have.
--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