title: TItanium Studio - iOS - ListView with label-child
body: <p>My problem is the following: I have a listview in which I need to dynamically load a set of labels (of which I do not know the length), the height of each child of the listview (ie each label) should change according to the length of the label, but unfortunately I do not know how to do</p>
  
  <p><img src="https://i.stack.imgur.com/zo1sa.png" alt="enter image description here"></p>
  
  <p>Test - Code</p>
  
  <pre><code>var win = Titanium.UI.createWindow();
  
  var template = {
      childTemplates : [{
          type : 'Ti.UI.Label',
          bindId : 'label',
          properties : {
              left : 0,
              width : 300,
              height : 'auto',
              textAlign : "left",
              color : "red",
              font : {
                  fontSize : 12
              },
              backgroundColor : "#42de0b"
          }
  
      }]
  };
  
  
  var tabella = Ti.UI.createListView({
          width : 300,
          height : 300,
          separatorColor : 'transparent',
          backgroundColor : 'transparent',
          separatorInsets : {
              left : 0,
              right : 0
          },
          showVerticalScrollIndicator : false,
          templates : {
              'plain' : template
          },
          defaultItemTemplate : 'plain'
  });
  
  
  var data_record = [];
  
  for (var i = 0; i &lt; 10; i++) {
  
      data_record.push({
  
          label : {
              text : "test test test test test test test test test test test test test test test test test "
          },
          properties : {
              selectionStyle : Ti.UI.iPhone.ListViewCellSelectionStyle.NONE,
              height : 20
          }
      });
  
  }
  
  
  var intestazione = Ti.UI.createListSection();
  tabella.sections = [intestazione];
  
  
  intestazione.appendItems(data_record, {
      animationStyle : Ti.UI.iPhone.RowAnimationStyle.TOP
  });
  
  win.add(tabella);
  
  win.open();
  </code></pre>