Search code examples
iostitanium

TableViewRow height in Titanium


I don't know why the TableView hides the end of a long string automatically for me. Is there a way that I can avoid that? Here are screenshot and code:

Screenshot

var data = [];

var row = Ti.UI.createTableViewRow();
var label = Ti.UI.createLabel({ text: 'ALongLongLongLongLongLongLongLongLongStringFromDatabaseOrSomewhere~', });

row.add(label);
data[0] = row;

var table = Titanium.UI.createTableView({
    data: data,
    style: Titanium.UI.iPhone.TableViewStyle.GROUPED,
});

Ti.UI.currentWindow.add(table);

Thanks a lot.


Solution

  • var toImg = row.toImage(),
    rowHeight = toImg.height;
    row.height = rowHeight;
    toImg = null;