Skip to content

Instantly share code, notes, and snippets.

@hansemannn
Created February 22, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansemannn/dc321ee21a64c5022537 to your computer and use it in GitHub Desktop.
Save hansemannn/dc321ee21a64c5022537 to your computer and use it in GitHub Desktop.
var win = Ti.UI.createWindow();
var view1 = Ti.UI.createView({ backgroundColor:'#123' });
var view2 = Ti.UI.createView({ backgroundColor:'#246' });
var view3 = Ti.UI.createView({ backgroundColor:'#48b' });
var view4 = Ti.UI.createView({ backgroundColor:'green' });
view3.addEventListener('click',function(e)
{
Titanium.API.info("You clicked the view3");
});
/*
view3.addEventListener('postlayout', function() {
Ti.API.info('postlayout event heard on view3');
});
*/
var scrollableView = Ti.UI.createScrollableView({
views:[view1,view2,view3,view4],
showPagingControl:true
});
scrollableView.addEventListener("click", function(e) {
Ti.API.warn("Click on ScrollableView container fired");
Ti.API.warn(e);
})
win.add(scrollableView);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment