Scroll to section top
Hello, just wondering how you scroll to the top of a tableviewsection. I have 2 section and sometimes I need to scroll to the second section which is way down the scroll. How do you do it?
1 Answer
-
Titanium.UI.TableView.scrollToIndex() scrolls to a row index. I am not sure it's possible to scroll to a section. Would it be feasible for you to determine the first row in a section, and scroll to its index instead?
An iphone-only feature is to pass constants to scrollToIndex, as follows:
tableView.scrollToIndex(10,{ position:Titanium.UI.iPhone.TableViewScrollPosition.MIDDLE, animated:true } );
There is more information about it in the docs and you can see it in action in the KitchenSink in table_view_row_insert.js