Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created November 10, 2010 14:49
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 kwhinnery/670939 to your computer and use it in GitHub Desktop.
Save kwhinnery/670939 to your computer and use it in GitHub Desktop.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#fff');
var win = Titanium.UI.createWindow({
title:'Testing'
});
var scrollView = Titanium.UI.createScrollableView({
currentPage:1,
showPagingControl: false
});
function doClick(e) {
var btn = e.source;
alert(" -- clicked button: " + btn);
};
for (var i = 0;i<20;i++) {
var newView = Ti.UI.createView();
var right = Titanium.UI.createButton({
image:'ui/right.png',
left: 10,
width: 20
});
right.addEventListener('click',doClick);
newView.add(right);
scrollView.addView(newView);
}
win.add(scrollView);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment