我将异步加载图像并将其设置为表格视图单元格。问题是我为我的单元格使用自动布局,所以我希望表格视图在设置图像后重绘单元格。重新绘制表格视图单元格而不调用cellForRowAtIndexPath
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 300.0
在通常情况下,我会使用tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Fade)
,但这种呼吁cellForRowAtIndexPath
方法,而这又要求我的图像下载方法。
我试着打电话给tableView.layoutIfNeeded()
,cell.layoutIfNeeded()
,cell.setNeedsLayout()
,没有什么帮助。
我的问题是如何重绘表格视图单元而不调用cellForRowAtIndexPath
方法?