开发者

NSSplitter how to prevent proportional space distribution on resize

I have a window with a source list sidebar at the right side and a content view on the left both inside an NSSplitView.

When i resize the window, the additional space is distributed to the source list and the content view. How can i make the source list to maintain its fixed width. All Apple appli开发者_如何学Ccations are doing this so i hope i just missed a method.


On SnowLeopard, there is a delegate method called splitView:shouldAdjustSizeOfSubview:. All you have to do is return NO for your source list view, and you should be good. If you need to support Leopard or earlier, you have to implement splitView:resizeSubviewsWithOldSize: and manually resize the subviews, keeping your source list view a fixed width, and resizing your other view to fill the split view's bounds (taking into account the divider's width).

Both methods are documented here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜