我需要使用 UITableView 更改 cellForRowAtIndexPath 中的行高。
heightForRowAtIndexPath 在 cellForRowAtIndexPath 之前执行,但在 cellForRowAtIndexPath 中,我将内容设置为行,具体取决于必须重新计算的高度。
最佳答案
你不能,你唯一可以而且应该改变的地方是 heightForRowAtIndexPath
但是对于您的问题还有其他解决方案,解释得很好 here
我鼓励您检查启用行高估计的第三个解决方案。
关于swift - 如何从 cellForRowAtIndexPath 更改行高?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34005906/