Autoheight Label
I have created a table where the text changes when clicked but if I have a really long sentence like below, it automatically adds an ellipses and I can't figure out where to put the autoheight text code to make it work. The code I am using is below
var win = Titanium.UI.currentWindow;
// create table view data
var data = [
{title:'This is the longest possible title you can do', title1: 'This is the longest possible title you can do', title2: 'Text Changing'},
];
var search = Titanium.UI.createSearchBar({
showCancel:false
});
var tableView = Titanium.UI.createTableView({data:data, search:search, filterAttribute:'title'});
tableView.addEventListener('click',function(e){
if(e.rowData.title == e.rowData.title1) {
e.row.title = e.rowData.title2;
} else if(e.rowData.title == e.rowData.title2) {
e.row.title = e.rowData.title1;
}
});
win.add(tableView);
1 Answer
-
I also had some problems with autohight and figured that it works best to just remove the label and create a new one with the new text. Works for me.