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.
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?
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?