Type Function Library widget.* Revision Release 2022.3683 Keywords table view, list view, TableViewWidget, scrollToY See also object:scrollToIndex() widget.newTableView() TableViewWidget
Makes a TableViewWidget scroll to a specific y position. Note that the current y position can be retrieved with object:getContentPosition().
object:scrollToY( options )
This function requires a single argument, options
, which is a table that accepts the following parameters:
Number. The y position to scroll to.
Number. Time in milliseconds to scroll to the specified position. For an instantaneous effect (no transition), set this to 0
. Default is 400
.
Function. An optional function that will be called when the scroll completes.
local function scrollComplete() print( "Scroll complete!" ) end -- Scroll the table view to -300 tableView:scrollToY( { y=-300, time=600, onComplete=scrollComplete } )