How to know if a row is currently off-screen in tableView?

In tableView, a row that is off-screen will get re-rendered when it’s on-screen again.

My question is how to know if a row currently is off-screen or not?

The situation I am facing is that I might need to download an image from the Internet for each item. So when an image comes, the row probably is off-screen or on-screen. If it’s on-screen, the image has to be applied immediately and if it’s off-screen, I don’t need to put that image on the row.

Or maybe there is other way to achieve this?

Just add it to the row whether its off or on screen. tableView widget is clever not to load it if the row is offscreen but doing it this way it also knows that now it needs to load that image when the row goes on screen. So in summary, just insert the image(s) as they become available. 

When you said “just add it to the row”, how to do this in actual coding?

I mean… a row is rendered by onRowRender listener, so when the image is downloaded successfully from the Internet,

inside the network request handler, how do I add it to the row? 

can I just store all “event.row” in onRowRender() into a table, and when the image comes, I just add it to the “row object” (i.e. event.row stored earlier) ?

Another thing is… do you think maybe I should just use scrollView to do this? Is tableView just built upon scrollView?

See this thread and the other one I link to from there : 

http://forums.coronalabs.com/topic/38541-loading-async-images-and-tableview/?hl=%2Bmpappas+%2Bimage#entry200107

Some great information and techniques shared in there by masters (Thanks guys!!!). 

tableView is fine for this but depending on what you need to do you can try the scrollView if you like of course. 

Good luck!

Just add it to the row whether its off or on screen. tableView widget is clever not to load it if the row is offscreen but doing it this way it also knows that now it needs to load that image when the row goes on screen. So in summary, just insert the image(s) as they become available. 

When you said “just add it to the row”, how to do this in actual coding?

I mean… a row is rendered by onRowRender listener, so when the image is downloaded successfully from the Internet,

inside the network request handler, how do I add it to the row? 

can I just store all “event.row” in onRowRender() into a table, and when the image comes, I just add it to the “row object” (i.e. event.row stored earlier) ?

Another thing is… do you think maybe I should just use scrollView to do this? Is tableView just built upon scrollView?

See this thread and the other one I link to from there : 

http://forums.coronalabs.com/topic/38541-loading-async-images-and-tableview/?hl=%2Bmpappas+%2Bimage#entry200107

Some great information and techniques shared in there by masters (Thanks guys!!!). 

tableView is fine for this but depending on what you need to do you can try the scrollView if you like of course. 

Good luck!