简体   繁体   中英

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: 初始表视图

When I expand the column, the (truncated) table view cell doesn't expand with the column: 调整列宽

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

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

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

步骤1

Step 2: Change these constraints

第2步

Step 3: Change these constraints aswell

第3步

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM