美文网首页iOS学习iOS开发坑点
tableView reloadRows或reloadData刷

tableView reloadRows或reloadData刷

作者: Desmond_ | 来源:发表于2018-08-30 09:42 被阅读9次

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

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

    相关文章

      网友评论

        本文标题:tableView reloadRows或reloadData刷

        本文链接:https://www.haomeiwen.com/subject/yifrwftx.html