//FirstView Component Constructor function FirstView() { //create object instance, a parasitic subclass of Observable var self = Ti.UI.createView({ layout: 'vertical' }); //label using localization-ready strings from /i18n/en/strings.xml var label = Ti.UI.createLabel({ color:'#000000', text:String.format(L('welcome'),'House of Beor'), top: '5dp', center: '150dp' }); self.add(label); var label2 = Ti.UI.createLabel({ color:'#000000', text:String.format(L('beren')), top: '40dp', center: '150dp' }); var myTableView = Ti.UI.createTableView({ width:'90%', height:'85%', top:60, backgroundColor:'transparent', separatorStyle:Titanium.UI.iPhone.TableViewSeparatorStyle.SINGLE_LINE }); var row = Ti.UI.createTableViewRow({ backgroundColor:'transparent', height:74 }); var primaryLabel = Ti.UI.createLabel({ text:'This is a great row!', font:{ fontSize:16, fontWeight:'bold' }, color:'black', top:42, left:75, height:'auto' }); var secondaryLabel = Ti.UI.createLabel({ text:'Great rows are born at House of Beor!', font:{ fontSize:13, fontWeight:'bold' }, color:'black', top:42, left:75, height:'auto' }); row.add(primaryLabel); row.add(secondaryLabel); var tblData = []; tblData.push(row); myTableView.setData(tblData); self.add(label); self.add(label2); self.add(myTableView); //Add behavior for UI label.addEventListener('click', function(e) { alert(e.source.text); }); return self; } module.exports = FirstView;