本文介绍了在文本编辑期间,Nscell大小不随行高增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的NSTableView有可变高度行。在单元格编辑完成后,以及在调整列/表大小时/之后,行会正确调整大小。当用户输入文本单元格时,该行也会正确调整大小。

My NSTableView has variable height rows. The rows correctly resize after an edit of a cell has been completed, and during/after resizing the column/table. The Row also correctly resizes while a user is typing into the text cell.

但是,单元格本身在编辑时不会调整大小以匹配行的高度。有没有人对此有任何想法?在中发生了一个结束编辑已经(这就是为什么文本区域大于1行),但单元格中目前有足够的文本约占5行,因此行的高度不匹配应显示的内容。

However, the cell itself does NOT resize during editing to match the height of the row. Does anyone have any ideas on this? In this screenshot one end-edit has occurred already (which is why the text area is larger than 1 line) but there is currently enough text in the cell to account for about 5 lines, thus the height of the row is not matching what should be displayed.

推荐答案

textview和单元格都必须设置自动调整大小,如果你想让它们自动缩放。

Both the textview and the cell have to have their autoresize set if you want them to automatically scale.

看起来像标记名称列中的单元格已正确设置为调整大小,但单元格或在列中的textview尚未。检查Interface Builder中的坐姿。

It looks like the cells in the Tag Name column are properly set to resize but that either the cell or the textview in the value column has not been. Check the sittings in Interface Builder.

这篇关于在文本编辑期间,Nscell大小不随行高增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 06:47