Problem with text overlapping TableView
Text is overlapping it´s section.
Someone knows why and how to solve this?
My code is as follows:
//for treating text with \n and \r correctly
function evalStrings(string) {
eval('result="'+string+'"');
return result;
}
var data = [];
var section = Ti.UI.createTableViewSection({
font:{fontSize:12},
height: 'auto',
width: 'auto',
top: 10,
bottom: 40,
left: 10,
right: 20
});
var row1 = Ti.UI.createTableViewRow({
height: 'auto',
backgroundColor:'#fff'
});
var label = Ti.UI.createLabel({
text:evalStrings(row.fieldByName('text')),
height: 'auto',
width: 'auto',
highlightedColor: '#fff',
top: 10,
bottom: 20,
left: 10,
right: 10,
font : {
fontSize : 12
}
});
row1.add(label);
section.add(row1);
data.push(section);
var testTable = Titanium.UI.createTableView( {
data: data,
headerView : headerView,
selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE,
backgroundColor:'#fee5ab',
style:Titanium.UI.iPhone.TableViewStyle.GROUPED
});
1 Answer
-
Try using adding a unique className for each tableViewRow… hope that helps