NSSplitView - Preserve subview width on window resize

237 Views Asked by At

I have an NSSplitView covering all of my window.

The NSSplitView contains two (vertical) subviews, one next to the other.

When the user resizes the window, I want the one on the left to remain intact. How is that doable?


P.S. Not the AutoLayout-way.

1

There are 1 best solutions below

0
On

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSWindowDelegate_Protocol/index.html#//apple_ref/doc/uid/TP40008202-CH1-SW6

Implement window delegate.

- windowWillResize:toSize: in this method save the width of the one on the left

- windowDidResize:in this method restore the width of the one on the left