[Bug]Cell重用导致的内容加载混乱
作者:
iCHENKE | 来源:发表于
2018-09-28 15:10 被阅读9次func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell = tableView.cellForRow(at: indexPath)
if cell == nil {
cell = UITableViewCell(style:.default, reuseIdentifier: "cell")
} else {
while (cell?.contentView.subviews.last != nil) {
cell?.contentView.subviews.last?.removeFromSuperview()
}
}
// 其他操作...
return cell!
}
本文标题:[Bug]Cell重用导致的内容加载混乱
本文链接:https://www.haomeiwen.com/subject/ovrpoftx.html
网友评论