问题描述
如何设置NSSplitView的开始位置?
How can I set the start position of a NSSplitView?
我发现最合适的东西是setPosition
The closest thing I've found that looks like it would work is setPosition
//Set splitView position.
[splitView setPosition:330 ofDividerAtIndex:0];
这似乎什么也没做,我的splitview仍然从中间的分隔线开始.
This doesn't seem to do anything though, my splitview still starts with the divider in the center.
有什么想法吗?
推荐答案
也许是中心?如果splitView已正确连接到您的拆分视图,则该代码应该可以正常工作.在尝试设置分隔线的位置之前,您可能应该记录[splitView minPossiblePositionOfDividerAtIndex:0]和[splitView maxPossiblePositionOfDividerAtIndex:0],以便知道可能的值.
Maybe that is the center? If splitView is correctly hooked up to your split view, that code should work. You should probably log [splitView minPossiblePositionOfDividerAtIndex:0] and [splitView maxPossiblePositionOfDividerAtIndex:0] before trying to set the position of the divider so you know the possible values.
这篇关于NSSplitView分隔线的起始位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!