1

i have a Vertical NSSplitView on my ViewController i set a Width constraint of >=200 for the left controller. This works in the sense that it won't let me size it less than two hundred. However if i expand the form it changes the size of both the Left & Right Views. I want it to default to changing only the Right view. So the user can increase the Left View if she wants but when they resize the form it only resizes the Right View.

4

2 回答 2

4

您应该更改拆分窗格的保留优先级。

这些描述了窗格希望保持相同大小的优先级,主要用于描述当拆分视图更改大小时应该增加哪个拆分窗格的大小。

它们默认为每个窗格的 NSLayoutPriorityDefaultLow ,但是通过将右窗格设置为较低的值 (NSLayoutPriorityDefaultLow - 1) ,您将获得右窗格调整大小而左窗格保持不变的行为。

这是 xCode Interface Builder 的图片: 在此处输入图像描述

于 2014-10-14T16:04:38.103 回答
0

你实现了 NSSplitViewDelegate 吗?委托提供对大小、约束等的精确控制。

见 NSSplitViewDelegate

-splitView:shouldAdjustSizeOfSubview:

这将阻止自动调整大小

NSSplitViewDelegate

于 2014-10-14T15:38:23.037 回答