Created
May 14, 2016 22:04
-
-
Save hansemannn/6d2c919c7e584130dd1dea37b68da38f 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.createWindow({ | |
title: 'Tab 1', | |
backgroundColor: '#fff', | |
layout: "vertical" | |
}); | |
// Create a Button. | |
var save = Ti.UI.createButton({ | |
title: 'save', | |
height: Ti.UI.SIZE, | |
width: Ti.UI.SIZE, | |
top: 30, | |
}); | |
// Listen for click events. | |
save.addEventListener('click', function(e) { | |
alert('touchEnabled = ' + (e.source.touchEnabled)); | |
}); | |
// Create a Label. | |
var testlabel = Ti.UI.createLabel({ | |
text: 'testlabel', | |
color: '#000', | |
font: { | |
fontSize: 40 | |
}, | |
height: Ti.UI.SIZE, | |
width: Ti.UI.SIZE, | |
top: 50, | |
}); | |
// Listen for click events. | |
testlabel.addEventListener('click', function(e) { | |
alert('touchEnabled = ' + (e.source.touchEnabled)); | |
}); | |
// Add to the parent view. | |
var view = Ti.UI.createView({ | |
width: 100, | |
height: 50, | |
backgroundColor: 'red', | |
top: 20 | |
}); | |
// Listen for click events. | |
view.addEventListener('click', function(e) { | |
alert('touchEnabled = ' + e.source.touchEnabled); | |
}); | |
// Add to the parent view. | |
win.add(testlabel); | |
win.add(view); | |
win.add(save); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment