UITableViewCell 在后台加载并在完成后更新到特定的 tableViewCell

发布于 2024-12-12 06:44:48 字数 223 浏览 3 评论 0 原文

我想让 tableView 像澳大利亚 SBS 新闻应用程序中的“部分”一样。首先加载列表(当后台线程从 url 获取图像时,图像仍然显示默认图像),并且在图像完成下载或从 URL 获取后,它将更新到特定的 tableViewCell。我怎样才能做到这一点?如果我使用线程,在主线程(performSelectorOnMainThread)中执行更新视图时如何返回到 tableViewCell 中的特定索引?

谢谢

I want to make tableView like "Sections" in SBS News Australia app. The list is loaded first (the image still show default image when the background thread get the image from url) and after the image is finished downloaded or get from the URL it will update to specific tableViewCell. How i can do that? If i use thread how can i go back to specific index in tableViewCell when performing update view in main thread (performSelectorOnMainThread)?

Thank You

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏日落 2024-12-19 06:44:49

完成加载单元格后,调用 [tableView reloadRowsAtIndexPaths:<#(NSArray *)#> withRowAnimation:<#(UITableViewRowAnimation)#>] 并且它将重绘它。您可以从 PerformSelectorOnMainThread 方法调用它。

When you finish loading the cell, call [tableView reloadRowsAtIndexPaths:<#(NSArray *)#> withRowAnimation:<#(UITableViewRowAnimation)#>] and it will redraw it. You can call it from the performSelectorOnMainThread method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文