我正在写为iPad的读者,显示在一个UIScrollView的UIScrollView动画laggy
每个图像加载时需要这种耐心(滚动时)后台线程图像(1024x1322最大)(总有3张已加载图片在最大)。
我的问题是:当数据被加载我更新的UIImageView,在我的后台线程这样的:
image= [[UIImage alloc] initWithContentsOfFile: file];
[content setImage:image]
这似乎“锁”在主线程,使UIScrollView的动画不流畅在所有。
感谢您事先的任何线索
您是否解决了这个问题?在图像密集型应用程序中将图像缓存到磁盘时遇到类似问题。仍然不知道一个好的解决方案。 http://stackoverflow.com/questions/3756863/scroll-view-and-table-view-performance-when-loading-images-from-disk – pmc255 2010-09-23 22:17:33
而且你不应该在主线程以外的线程中访问UIKit - http ://developer.apple.com/library/ios/#documentation/uikit/reference/UIKit_Framework/Introduction/Introduction.html - “UIKit类只能从应用程序的主线程中使用” – 2011-04-24 06:55:05