最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[基本搞懂]swift中UITableView中如何只刷新某个section的某个单独的行

Swift crifan 3902浏览 0评论

uitableview reload row

objective c – How to reload and animate just one UITableView cell/row? – Stack Overflow

objective c – Is it possible to refresh a single UITableViewCell in a UITableView? – Stack Overflow

iphone – Reload specific UITableView cell in iOS – Stack Overflow

后来经过:

[已解决]swift中已更新对应行的数据源但tableView的reloadRowsAtIndexPaths却还是出错崩溃:attempt to delete row 0 from section 0 which only contains 0 rows before the update

证明了:

至少此处,调用reloadRowsAtIndexPaths是没办法工作的。

还只能是调用reloadData

除非之前已经存在对应的cell了。。

但是之前存在的cell,其实又不是对应的此处新增row的cell。。。

所以还是:

对于新增加/插入对应的row所对应的数据的话,只能调用reloadDat才能使得界面刷新正常

而对于之前已经(UI界面上)存在对应的行(UITableViewCell)的话,想要刷新对应的行,才可以通过reloadRowsAtIndexPaths去实现。。

转载请注明:在路上 » [基本搞懂]swift中UITableView中如何只刷新某个section的某个单独的行

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.166 seconds, using 22.26MB memory