Skip to content

Instantly share code, notes, and snippets.

@iotashan
Created December 13, 2011 20:22
Show Gist options
  • Save iotashan/1473716 to your computer and use it in GitHub Desktop.
Save iotashan/1473716 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('#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();
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