Skip to content

Instantly share code, notes, and snippets.

@hal-gh
Created December 26, 2011 14:55
Show Gist options
  • Save hal-gh/1521318 to your computer and use it in GitHub Desktop.
Save hal-gh/1521318 to your computer and use it in GitHub Desktop.
tableview padding
var win = Ti.UI.createWindow({
backgroundColor: 'white',
fullscreen: false
});
var data = [];
for(var i=0;i<20;i++){
var descriptionRow = Ti.UI.createTableViewRow({
height:100,
className:'rows'
});
var descriptionLabel = Ti.UI.createLabel({
top: 10,
left: 10,
right: 10,
bottom: 10,
// text: "If I set a fixed width on the label, it works as intended but that's not very dynamic. My app has to work for both iPhone and iPad"+i,
text: "jhgieg jieg jiefjiew jfijw idj ddjwi djwid jwid jdiwdj iwdj iwdjwidj widw dwijd iw jfiejf iefj iefjie fji ejfie fjeifjeifj eifj iedfkfo ekf oekf "+i,
font: { fontSize: 16 }
});
descriptionRow.add(descriptionLabel);
data.push(descriptionRow);
}
var tableView = Ti.UI.createTableView({
data: data,
style: Ti.UI.iPhone.TableViewStyle.GROUPED
});
win.add(tableView);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment