watchkitwkinterfacetable

How to implement scrollToRowAtIndex:animated: method in WKInterfaceTable


in WKInterfaceTable class,there is a method called scrollToRowAtIndex:(NSInteger)index,it just scrolls the row at the specified index into view with scrolling animation.I know that there isn't a method called scrollToRowAtIndex:(NSInteger)index animated:(BOOL)animated,but I am wondering if there is a workaround to disable scrolling animation effect when scrolling the table.Thanks in advance. :-]


Solution

  • In WatchKit 2.0 there is a method for TableView that do scroll to your desired row.

    table.scrollToRowAtIndex(0)
    

    https://developer.apple.com/library/prerelease/ios/documentation/WatchKit/Reference/WKInterfaceTable_class/#//apple_ref/occ/instm/WKInterfaceTable/scrollToRowAtIndex: