简体   繁体   中英

How to scroll smoothly with UIImage from url in tableview cell

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 put 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM