Created
December 13, 2011 20:22
-
-
Save iotashan/1473716 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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Titanium.UI.setBackgroundColor('#000'); | |
var Common = require('Common'); | |
var testModule = new Common('Hello, world!'); | |
var win1 = Titanium.UI.createWindow({ | |
title:'Tab 1', | |
backgroundColor:'#fff' | |
}); | |
var label1 = Titanium.UI.createLabel({ | |
color:'#999', | |
text:testModule.doIt(), | |
font:{fontSize:20,fontFamily:'Helvetica Neue'}, | |
textAlign:'center', | |
width:'auto' | |
}); | |
win1.add(label1); | |
// open tab group | |
win1.open(); |
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
function Common(input) { | |
this.phrase = input; | |
}; | |
Common.prototype.doIt = function() { | |
return this.phrase; | |
}; | |
module.exports = Common; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment