已解决...根据 DannyM 的回答。我还注意到,将标签的顺序添加到行中也很重要。
for (var i = 0; i < results.length; i++)
{
// Create a row and set its height to auto
row = Titanium.UI.createTableViewRow
({
height:'auto',
layout :'vertical'
});
var currentObj = results[i];
// Create the label to hold the place name
var placeNameLabel = Titanium.UI.createLabel
({
text:currentObj.PlaceName,
left:'75dp',
top:'auto',
width:'auto',
height:'18dp',
textAlign:'left',
font:{fontSize:'14dp',fontWeight:'bold'},
wordWrap:true
});
var placeAddressLabel = Titanium.UI.createLabel
({
text:currentObj.PlaceAddress,
left:'75dp',
top:'auto',
width:'230dp',
height:'auto',
textAlign:'left',
font:{fontSize:'14dp'}
});
var checkInDate = Titanium.UI.createLabel
({
text:currentObj.CheckInDate+' '+currentObj.CheckInTime,
left:'75dp',
top:'auto', //placeAddressLabel.height + 30 +'dp',
width:'165dp',
height:'25dp',
textAlign:'left',
font:{fontSize:'14dp'},
wordWrap:true,
});
row.add(placeNameLabel);
row.add(placeAddressLabel);
row.add(checkInDate)
tableData[i] = row;
}
return tableData ;