Note that there are some explanatory texts on larger screens.

plurals
  1. POTableview image cancelling in Titanium Mobile
    text
    copied!<p>(Reposted from <a href="http://developer.appcelerator.com/question/131750/cancel-image-downloads-in-tableview" rel="nofollow">the titanium Q&amp;A section</a>)</p> <p>I have an Android only Titanium 1.8.1 mobile app with a tableview with images in the cells (with classNames to enable cell reuse) which download from URLs. My table has up to a thousand rows (please don't tell me this is bad, its what my client wanted.)</p> <p>When I scroll through the rows, it starts downloading images and displaying them correctly. When I tested it on a mobile internet connection that is a bit slow, I noticed that the downloads are not cancelled when an image moves off screen (and presumably its cell is reused). Instead they display the "Loading" default image until the downloads have "caught up" to the user (scrolling back up shows that they have been downloading serially.) The intended behaviour is to skip any images that aren't currently on the screen if they haven't downloaded before they move off the screen. This is so a user can skip to the items they are looking for, and wait for just those images to download instead of all of the preceding ones.</p> <p>I would have assumed that changing the URL on an imageview (when the tableview reuses the cell?) would cancel the old download and start a new one, but looking at the Titanium Mobile source code, this doesn't seem to be the case.</p> <p>Is there an easy way to do this that I am missing, or will I have to implement some convoluted solution?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload