Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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
    });
— asked September 18th 2010 by Florian Dehn
  • label
  • overlap
  • tableview
  • text
0 Comments

1 Answer

  • Try using adding a unique className for each tableViewRow… hope that helps

    — answered November 22nd 2010 by Henry Belmont
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.