表视图与图像,慢负载和滚动 [英] Table View with Images, slow load and scroll

查看:111
本文介绍了表视图与图像,慢负载和滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天尝试了大约30个教程并且无法正常工作。

I tried impletmenting about 30 tutorials today and just cant get anything to work.

我的问题是我通过JSON文件加载我的信息,将数据添加到一个NSMutableArray,然后使用一个表来显示它。当我没有图像时,它工作正常,但当我的负载非常慢,滚动非常粘。在今天的调查结果之后,我有点了解它每次滚动都会重新加载图像,这就是为什么它的速度很慢。

My problem is that i load my information via a JSON file, add the data to a NSMutableArray, then use a table to display it all. It works fine when i dont have the images, but when i do its loads very slow and scrolls very sticky. I sorta understand after todays findings that its reloading the images every scroll which is why its slow.

有人可以将它分解并让我更容易解决这个问题?

Can someone please break it down and make it easier for me to solve this problem?

Alex

推荐答案

看看 Apple的LazyTableImages示例。基本上它归结为

a)重复使用表格单元格

a) reusing your table cells

b)仅加载当前可见的图像

b) only loading images that are currently visible

这篇关于表视图与图像,慢负载和滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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