Skip to content

Instantly share code, notes, and snippets.

Created September 18, 2010 16:27
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 anonymous/585819 to your computer and use it in GitHub Desktop.
Save anonymous/585819 to your computer and use it in GitHub Desktop.
var win = Titanium.UI.currentWindow;
var view1 = Ti.UI.createView({
width:200,
height:200,
top:150,
backgroundColor:'red'
});
var label1 = Ti.UI.createLabel({
text:'Click on me 2',
color:'white',
font:{fontSize:15,fontWeight:'bold'},
width:'auto',
height:'auto'
});
view1.add(label1);
view1.addEventListener('click',function(e)
{
Ti.API.info('view1 event firing (red)');
});
var view2 = Ti.UI.createView({
width:200,
height:200,
top:150,
borderRadius:10,
backgroundColor:'purple'
});
view2.addEventListener('click',function(e)
{
Ti.API.info('view2 event firing (purple)');
});
win.add(view2); // purple
win.add(view1); // red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment