开发者

How to scroll smoothly with UIImage from url in tableview cell

开发者 https://www.devze.com 2022-12-16 01:44 出处:网络
I try to display UIImage from url in tableview cell but it\'s not scroll smoothly. at time to scroll image is not cached and every time it goes to url to display and scroll is stick some while

I try to display UIImage from url in tableview cell but it's not scroll smoothly.

at time to scroll image is not cached and every time it goes to url to display and scroll is stick some while

[cell setProductImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[dict_productinfo valueForKey:@"productimage"]]]]]

I make custom cell and pu开发者_开发问答t imageview on that to display image


Try loading your images asynchronously. Your main thread has to wait for each image to be loaded before it can continue to draw your table view.

This might be a litte too complex to explain here so take this sourcecode as a reference

0

精彩评论

暂无评论...
验证码 换一张
取 消