iOS - UITableView刷新表正常吗? [英] iOS - UITableView refresh table properly?

查看:93
本文介绍了iOS - UITableView刷新表正常吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的tableView中有很多数据和很多行。
当数据发生变化时我想在屏幕上更新我的可见单元格,我真的不想使用reloadData,因为这是一个昂贵的调用。

I have lots of data and lots of rows in my tableView. when data changes I want to update my visible cells on the screen, I really don't want to use reloadData because it's an expensive call.

是吗有可能以某种方式更新可见细胞吗?
我试过打电话: beginUpdate &桌上有 endUpdate ,但这不能一直有效吗?

Is it possible to somehow update the visible cells only? I tried calling : beginUpdate & endUpdate on the table, but that doesn't work all the time?

有什么建议吗?

推荐答案

你可以:

[tableView reloadRowsAtIndexPaths:[tableView indexPathsForVisibleRows] 
                 withRowAnimation:UITableViewRowAnimationNone];

这篇关于iOS - UITableView刷新表正常吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆