Question

Is it possible to achieve the following just using the auto-layout options available from Xcode? For example by changing hugging or compression settings.

Expanding only one panel of an NSSplitView using auto-layout

What is the recommended way of achieving this resize behaviour?

Was it helpful?

Solution

If you want to achieve a fixed left panel, just select the left view in Interface Builder an choose "Editor" → "Pin" → "Width". This will make the divider unmovable, though.

If you want to keep a draggable divider, you can use the "Holding Priorities" slider in IB. To prioritize growth of the right panel, select the split view in IB and lower the "Right" holding priority to 1.
Note that those priorities have been added in Mountain Lion. Details can be found in the 10.8 AppKit release notes.

If you need to support 10.7, achieving this NSSplitView behavior might be way harder. Apple fixed several bugs and shortcomings with 10.8 (especially in conjunction with split views).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top