有些时候用 reloadRows 刷新指定 cell 或者 reloadData 刷新整张表格时,会发生表格闪烁跳动的现象,即使你指定了 UITableViewRowAnimation = .none 也无济于事,这时可以试试下面这种方法:
UIView.performWithoutAnimation {
tableView.reloadRows(at: [indexPath], with: UITableViewRowAnimation.none)
}
有些时候用 reloadRows 刷新指定 cell 或者 reloadData 刷新整张表格时,会发生表格闪烁跳动的现象,即使你指定了 UITableViewRowAnimation = .none 也无济于事,这时可以试试下面这种方法:
UIView.performWithoutAnimation {
tableView.reloadRows(at: [indexPath], with: UITableViewRowAnimation.none)
}
本文标题:tableView reloadRows或reloadData刷
本文链接:https://www.haomeiwen.com/subject/yifrwftx.html
网友评论