Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Expand NSTableCellView Width When Resizing Column in NSTableView

I am trying to display a path in my table view. Both columns of the table view on the left side are the same for testing/demonstration purposes. Notice how the leftmost path is truncated: Initial table view

When I expand the column, the (truncated) table view cell doesn't expand with the column: Resized column width

My question is how would I go about resizing the cell when I resize the table view column?

like image 737
Stunner Avatar asked Aug 26 '14 12:08

Stunner


1 Answers

Found a solution, what you want to do is add a few constraints

Step 1: go to the table cell view for said column

Step 1

Step 2: Change these constraints

Step 2

Step 3: Change these constraints aswell

Step 3

Step 4: run your app and look at your nice table :-D

like image 179
nsij22 Avatar answered Sep 27 '22 22:09

nsij22