Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-3356

iOS: Support TableView Auto Height (on the table itself)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Won't Do
    • Affects Version/s: Release 1.6.2
    • Fix Version/s: None
    • Component/s: iOS

      Description

      {html}<div><h1>Problem</h1>
      <p>If you set the height of a table view to "auto", its height will
      end up as 0 regardless of its content.</p>
      <h1>Expected Behavior</h1>
      <p>A table view with height: 'auto' should calculate its height
      based on the heights of its rows.</p>
      <h1>Log</h1>
      <pre>
      <code>[WARN] [object TiUITableView] has an auto height value of 0, meaning this view may not be visible.</code>
      </pre>
      <h1>Sample Code</h1>
      <p>The following code demonstrates the problem. Note that you can
      set "workaround" to true to calculate the height by spinning
      through the rows.</p>
      <pre>
      <code class="javascript">var win = Ti.UI.createWindow({
      backgroundColor: '#999'
      });

      var rows = [
      { title: "Row 1", height: 30 },
      { title: "Row 2", height: 45 },
      { title: "Row 3", height: 15 },
      { title: "Row 4", height: 30 },
      { title: "Row 5", height: 25 }
      ];
      var table = Titanium.UI.createTableView({
      top: 0,
      data: rows,
      height: 'auto'
      });
      var workaround = false;
      if (workaround) {
      var height = 0;
      for (var i = 0, l = rows.length; i < l; i++) { height += rows[i].height; }
      table.height = height;
      }

      win.add(table);

      win.open();</code>
      </pre>
      <h2>Associated Helpdesk Ticket</h2>
      <p><a href=
      "http://developer.appcelerator.com/helpdesk/view/76514">http://developer.appcelerator.com/helpdesk/view/76514</a></p></div>{html}

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                dtoth Dawson Toth
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-2884
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration