Created
March 23, 2011 22:33
-
-
Save pec1985/884184 to your computer and use it in GitHub Desktop.
Center the title of a row with the Super Cool Row function
This file contains hidden or 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
// Created by @pecdev with the help of @pec1985 | |
// Follow either on Twitter | |
// | |
// Center the title of a row with the Super Cool Row function | |
var tableData = []; | |
function mySuperCoolRow(e){ | |
var row = Ti.UI.createTableViewRow({backgroundColor:e.bgColor,height:e.height}); | |
var label = Ti.UI.createLabel({text:e.title,width:'auto',height:50,font:{fontSize:20,fontWeight:'bold'}}); | |
row.add(label); | |
return row; | |
} | |
for (var i = 0;i<20;i++){ | |
tableData[i] = mySuperCoolRow({title:'Hello '+i,height:75,bgColor:'#ccc'}); | |
} | |
var table = Ti.UI.createTableView({data:tableData}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment