I noticed a while back that someone had asked for this in the api for newTableView(), but as far as I can tell there is no Corona function for it as yet.
Has anyone managed to come up with a reliable working version? Obviously I’m aware that updating the content to be displayed will be up to us, I’m simply curious about the mechanics of the pull down implementation.
I have tried making row 1 the “pull down to refresh” row, and the as soon as the list appears using:
list:scrollToIndex( 2, 0 )
to “push” it up above the top of the screen. The problem here is that if I touch the list at all and then release the list autoscrolls back to index 1 (unless there are enough rows to fill the screen but that’s not the case when the user first uses the app since they are rows of user data).
I also tried using a frame listener to check the position of the list itself - if it had been pulled down enough then it would trigger a reload:
if list:getContentPosition() \>=0 then...
The problem with this is that I don’t want it to refresh unless the user RELEASES their touch with the list scrolled down - if they pull it down then change their mind, they should be able to scroll back themselves and prevent the refresh from starting. To make this happen would require the list (NOT the rows but the list itself) to have a touch listener checking for a release, but to have touch listeners for the list on top of touch listeners for the rows (and touch listeners on buttons within the row) seems very messy.
So…does anyone have any suggestions, as I imagine it’s something that is fairly useful for anyone who uses tableViews? [import]uid: 84115 topic_id: 32496 reply_id: 332496[/import]
[import]uid: 84115 topic_id: 32496 reply_id: 129278[/import]