0
votes

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.

2
You can set label's height, width. - Muhammad Zeeshan
I know that, but the height of content is not the same. - iForests
But you can still set labels position i:e left, top etc. - Muhammad Zeeshan
And how can left and top solve my original problem? - iForests

2 Answers

3
votes
var toImg = row.toImage(),
rowHeight = toImg.height;
row.height = rowHeight;
toImg = null;
0
votes

try

var row = Ti.UI.createTableViewRow({
  height: 'auto'
});

or

var row = Ti.UI.createTableViewRow({
  height: Ti.UI.SIZE
});

if you are version 2.0 or greater.