【发布时间】:2017-10-03 09:00:51
【问题描述】:
我正在使用动态高度表视图单元格和 Haneke 使用以下代码下载和缓存图像:
override func viewDidLoad() {
super.viewDidLoad()
myTableView.rowHeight = UITableViewAutomaticDimension
myTableView.estimatedRowHeight = 500
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell:ImageCellTableViewCell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! ImageCellTableViewCell;
cell.myImageView.hnk_setImage(from: URL(string: imageUrl), placeholder: nil)
return cell
}
这里我需要在下载后设置图像时调整单元格高度。 下载图像后如何调整表格视图单元格的大小。
【问题讨论】:
标签: ios swift uitableview uitableviewautomaticdimension