I am trying to display a simple TableView with two lines of text on each row using this code:
var row = Titanium.UI.createTableViewRow({ height:'auto', layout:'vertical' }); var title = Titanium.UI.createLabel({ text:tableview_rows[i][0], textAlign:'left', left:0, height:'auto', width:'auto', font:{fontSize:16,fontWeight:'bold'} }); var subtitle = Titanium.UI.createLabel({ text:tableview_rows[i][1], textAlign:'left', left:0, height:'auto', width:'auto', font:{fontSize:14} }); row.add(title); row.add(subtitle); tableview.appendRow(row);The
tableview_rows variable is an array of titles and subtitles declared earlier. Sometimes this code works properly: the title is displayed in bold above the subtitle for each row; this happens on an Ubuntu 9.10 Linux machine and on one Windows XP machine. Other times the title and subtitle overlap on a single line in each row; this happens on a different Windows XP machine.
Both of the machines where it works properly are virtual machines running inside VirtualBox, while the machine where it doesn't work is a physical machine, though I don't see why that should make any difference.
Any thoughts?
2 Answers
You should use on the 2nd label the "top" property
like: top: 50% or top: row.height / 2;
Look here for the trick that I used: Answer-224298
Your Answer
Think you can help? Login to answer this question!