iOS学习iOS开发坑点

tableView reloadRows或reloadData刷

2018-08-30  本文已影响9人  Desmond_

有些时候用 reloadRows 刷新指定 cell 或者 reloadData 刷新整张表格时,会发生表格闪烁跳动的现象,即使你指定了 UITableViewRowAnimation = .none 也无济于事,这时可以试试下面这种方法:

UIView.performWithoutAnimation {
        tableView.reloadRows(at: [indexPath], with: UITableViewRowAnimation.none)
}
上一篇下一篇

猜你喜欢

热点阅读