Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable resizing of the subview of NSSplitView in Interface Builder?

I've created in Interface Builder a NSSplitView with two subviews. I want the left-side view to have fixed width. I've tried to define autosizing rules for both subviews but the left subview still changes width on window resizing (split view fills up a window). May be that caused by NSSplitView's Autoresizes Subviews property? (I can't uncheck it). What can I do?

like image 235
dzolanta Avatar asked Jan 10 '10 22:01

dzolanta


1 Answers

The best way I found to do this in Interface Builder:

  • Drop the NSSplitView on the window
  • Select the Custom View you want fixed
  • Go up to the Xcode menu and select Editor > Pin > Width
  • Adjust the Constant in the Attributes Inspector to the size that you want the panel to be fixed at

Of course, you can also add this layout constraint through code as suggested above if you're feeling adventurous.

like image 73
Chris Livdahl Avatar answered Oct 03 '22 00:10

Chris Livdahl