Autolayout frustrations with NSOutlineView
Autolayout frustrations with NSOutlineView
- Subject: Autolayout frustrations with NSOutlineView
- From: Graham Cox <email@hidden>
- Date: Wed, 30 Jul 2014 11:12:39 +1000
I'm having problems adopting autolayout in part of my UI which is built around NSOutlineView.
My requirements are straightforward, I believe. The outline view can scroll vertically but not horizontally, so its width should follow the width of the scrollview/clip view that contains it. The width adjustment only affects the last column of the table, so I have that set inthe outline view settings.
The problem I have is that IB will not let me add any constraints between the enclosed NSOutlineView and the scrollview or clipview - the 'add constraints' panel is all greyed out and nothing can be enabled. I also can't control-drag between these views, one reason being that the scrollview itself is completely invisible in IB, so there's no target for the drag.
I'm just feeling my way with autolayout, so my understanding of it is far from fluent, but I have managed to get most other elements working as I wish. One complicaiton with my interface here is that the whole assembly of scroller+outline view plus some other related views are all in their own nib and are dynamically loaded into a subview that belongs to a split view. However, all of that works OK - the split view is resizing as I want it to, and the view that ultimately contains my outline view is resizing as it should. I can see that the scroller is resizing horizontally, it's just that the outline view within it is not.
One of the things I'm a bit unclear on is the 'content compression resistance priority' of the outline view, which I've set to be a lowish number (90), my thinking being that I want it to compress readily, so this value should be 'weak'. Or does that imply this should be a high number to ensure that the compression is allowed as a priority? The documentation doesn't really help me understand this. Anyway, changing this value has no effect on the result, so it may be a red herring.
TL;DR: How can I make the width of my outline view match the width of its enclosing scrollview?
--Graham
_______________________________________________
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