Skip to content

Instantly share code, notes, and snippets.

@srahim
Created April 17, 2012 00:30
Show Gist options
  • Save srahim/2402543 to your computer and use it in GitHub Desktop.
Save srahim/2402543 to your computer and use it in GitHub Desktop.
ScrollEnd test on tableveiw
var win = Ti.UI.createWindow();
var data = [
{title:"Row 1"},
{title:"Row 2"},
{title:"Row 3"}
];
var tableView = Ti.UI.createTableView({
data: data
});
win.add(tableView);
function loadmoredata()
{
// simulate loading
for (var c=4;c<100;c++)
{
tableView.appendRow({title:"Row "+c});
}
}
tableView.addEventListener('scrollEnd',function(e)
{
Ti.API.info(" ContentOffset :: x: "+e.contentOffset.x+", y: "+e.contentOffset.y);
Ti.API.info(" ContentSize :: width: "+e.contentSize.width+", height: "+e.contentSize.height);
Ti.API.info(" Size :: width: "+e.size.width+", height: "+e.size.height);
});
win.open();
loadmoredata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment