Optimized Image Loading in a UIScrollView

前端 未结 5 1738
离开以前
离开以前 2020-12-22 18:19

I have a UIScrollView that has a set of images loaded side-by-side inside it. You can see an example of my app here: http://www.42restaurants.com. My problem comes in with m

5条回答
  •  长情又很酷
    2020-12-22 19:23

    the problem is here:

     UIImage *image = [UIImage imageWithContentsOfFile:path];
    

    It seems that threaded or not when you load a file from disk (which maybe that happens on the main thread regardless, I'm not totally sure) everything stalls. You normally don't see this in other situations because you don't have such a large area moving if any at all.

提交回复
热议问题