Pull tableview trigger update
I have a tableview list loaded on tabbed window, and has a refresh nav. button to call function updating content. Well, instead of that button, i would love to be able hide it behind the tableview, says an arrow pointing up and trigger when user drag and pull the tableview down to some degree, the arrow then point downward and that calls the refresh function.
Will i be able to do that with Titanium mobile on iphone?
Thanks
5 Answers
-
Ahoi! To the rescue! For a pull-to-refresh for Android (similar thread) see my gist here:
For the pull-to-refresh for iPhone go here:
Do note that it's just an example, so for it to work with someones app it will need some modification. Hope this helps! Cheers!
-
I know there is the swipe event for tableViews.
tableView.addEventListener('swipe', function(e) { tvLabel2.text = 'table view swipe at ' + new Date().getSeconds(); });
But maybe you can also implement the scroll event on the tableView too,
take a look to scroll_view_tabs.js in the examples, maybe you can find a workaround to implement what you need.You may get the vertical direction and change the background image accordingly.
scrollView2.addEventListener('scroll', function(e) { for(v in e) { Ti.API.info('v ' + v + ' e[v] ' + e[v]); } });
-
Hi Daniel, do you mean like the Tweetie update? - pulling the tableview down reveals a new row which stays until update is complete, when it slides back up.
Chris.
-
Hi Chris, similar to that, how do i go about accomplish that?
-
a good one on the market works fine with tableview,
check this link :