How do I tell NSTableView not to resize all other columns when showing/hiding a column?

StackOverflow https://stackoverflow.com/questions/900908

  •  23-08-2019
  •  | 
  •  

Question

I have an NSTableView, and I have the ability for the user to show or hide columns dynamically (with a mail-style header context menu).

My issue is that if the table view is currently wider than it's scroll view (i.e. it's displaying a horizontal scroll bar) when a column is hidden or shown it resizes every single visible column such that they all fit on the screen again. How do I make it, well, not. I just want the hidden/shown column hidden/shown without any resizing of the other columns.

I tried setting the column resizing style to None is interface builder, but that didn't have any effect.

Was it helpful?

Solution

You can do this by selecting each column individually in IB and disabling the Attributes->Resizes With Table checkbox.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top