1

I have an NSTableview on the contentview of an NSWindow. When I resize the window, I would like the height of the NSTableview to resize. This isn't working.

To make sure I haven't set something incorrectly, I created a new mac project, view-based, storyboard. In IB, I added an NSTableView to the view. It looks like the default is to have autoresizing on, so I made no changes. Run this sample project, resize the window and the tableview does not resize. I guess I am missing something. What is it??

BTW, I am using xCode 6.3

Rick Schlueter
  • 141
  • 1
  • 10
  • BTW, this doesn't seem to work with an NSView either. I just added an NSView to the NSWindow contentView and it doesn't resize either when I resize the window. – Rick Schlueter Apr 18 '15 at 23:59

1 Answers1

2

• While viewing the xib, select the Bordered Scroll View that contains your table.

• In the lower-right of the xib canvas, you'll see 4 icons. The 2nd icon is called "Pin" if you hover your mouse over it. Click that.

• In the view that pops up, click the 4 red constraint connectors, then click "Add 4 Constraints".

Rupert Pupkin
  • 742
  • 6
  • 9
  • Thanks, that put me into the right direction. Most of the constraints were disabled and none red, but but control clicking from the scrollview to the superview I was able to add the correct top and bottom constraints to get the effect I needed. – Rick Schlueter Apr 19 '15 at 17:28