How should I use auto layout constrains inside NSSplitView
subview?
My NSSplitView
subview has 3 subview: topPane
, tableCont
You do not want to disable translatesAutoresizingMaskIntoConstraints
at all. You shouldn't mess with system views constraints. NSSplitView
handles the sizing for the individual views itself and you are essentially trying to rip it's control away. Not to mention, you forgot to account for the splitter.
The correct way to set a minimum or maximum (or constant for that matter) width/height on a splitview is to set those things on the views individually. In particular, if you are doing this in code you will need to use 2 separate calls to constraintsWithVisualFormat, because otherwise the visual format language will create constraints between the views.
You can do all of this in IB just fine. You can even set the priority of each view in the split view, which will cause one or the other view to resize when the window does rather than distributing the resize equally.