3 ms·
Another way to increase scrolling performance is to only load images after they are visible. However, it is fairly tricky to get it to work. Doing it in HTML a
by ricksta 15y ago
Another way to increase scrolling performance is to only load images after they are visible. However, it is fairly tricky to get it to work.
Doing it in HTML and CSS is indeed a lot easier.
- reidmain 15y agoCan you explain how this is tricky to get working? If we are talking about UITableView then it only asks you for a row when it is about to be displayed. So in that case you are only loading the image when it is about to become visible. I have no idea how this is done in HTML and CSS but in iOS it is still extremely easy.
- ricksta 15y agoIt's not bad if all your image assets is locally on device. It become difficult when your assets are remote. If your image is remote, you'll need to put loading the image on a separate thread, and create a nonblocking http request to fetch the image. The problem is to draw the picture you have to use the main thread, so to make scrolling smoothly become quite a challenge.
- reidmain 15y agoSo what do you do in HTML and CSS?