Is there an event that I can capture that fires when a tableView has finished being created and filled with rows?
I have encountered a problem when I recreate a tableView and scroll to the last Y position. It appears as though there is a slight delay in recreating the tableView such that If I do this:
[lua]
currentTvPosition = tableView:getContentPosition()
tableView:deleteAllRows()
tableView:removeSelf()
tableView = nil
tableView = widget.newTableView{ … }
insertTVRows() – insert up to 15 rows into the TV, text only
tableView:scrollToY({y = currentTvPosition, time = 0})
newTvPosition = tableView:getContentPosition()
print("Current TV y position: " … newTvPosition) – it will output the same positive integer each time, 285, which is exactly half the height of the tableView
– if I delay getting the position for a second, it accurately reports the current y position
timer.performWithDelay( 1000, function () print("Current Y position, delayed: " … tableView:getContentPosition() return true end,1 )
[/lua]
It would seem that I am getting a positive integer that is exactly half the height of the tableView height, but if I pause for a second, I am getting the actual y position. This behavior also occurs on the Windows simulator. On both Windows and Mac I am running daily build 2015.2705. I can’t run a newer build otherwise I run into a similar issue as this:
https://forums.coronalabs.com/topic/58979-scroll-view-error-in-daily-build-20152706/
Thank you!