Created
September 18, 2010 16:27
-
-
Save anonymous/585819 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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