在NSTableView中调整列大小时如何扩展NSTableCellView宽度 [英] How to Expand NSTableCellView Width When Resizing Column in NSTableView

查看:488
本文介绍了在NSTableView中调整列大小时如何扩展NSTableCellView宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在表格视图中显示路径.出于测试/演示目的,左侧表视图的两列均相同.注意最左边的路径是如何被截断的:

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

第1步: 进入该列的表格单元格视图

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

第2步: 更改这些约束

Step 2: Change these constraints

第3步: 还要更改这些约束

Step 3: Change these constraints aswell

第4步:运行您的应用并查看您的漂亮表:-D

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

这篇关于在NSTableView中调整列大小时如何扩展NSTableCellView宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆