Titanium Community Questions & Answer Archive

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

No components visible in TableView in 1.4

The following code works fine in 1.3.2

var win = Titanium.UI.createWindow({backgroundColor:'#ff0'});
var table = Titanium.UI.createTableView();
table.appendRow(Titanium.UI.createTableViewRow({title:'ROW #1'}));
var row = Titanium.UI.createTableViewRow();
var label = Titanium.UI.createLabel({text:'ROW #2'});
row.add(label);
table.appendRow(row);
win.add(table);
win.open();

It displays a table with 2 rows. With 1.4.0 only the first row is displayed. I wrote this test app since in my real app with 1.4.0 only blank tables are displayed.

I also read that you might have to set width/height whatever on the label and I tried lots of things, e.g. added textAlign:'left',left:0,width:'auto',height:'auto' to the label but nothings helps.

BTW: I tested in the iPhone simulator only so far since run on device and package both just say "packaging error" or something similar after a few seconds.

Any ideas?

— asked July 28th 2010 by Michael Descher
  • 1.4
  • iphone
  • tableview
3 Comments
  • I was able to build and deploy to device using xcode and the result is the same, an empty table view.

    — commented July 28th 2010 by Michael Descher
  • Tried a little more, everything works fine setting just the title property of a table view row. As soon as I add any other view instead (label, image view, etc), nothing but blank space is displayed. Also it seems nothing is rendered after the first row with a child view as subsequent simple rows with just a title property are not displayed either.

    — commented July 28th 2010 by Michael Descher
  • This is what another slightly more complex sample app looks like when built with SDK 1.3.2 ( http://i28.tinypic.com/s5czfl.png ) and with SDK 1.4.0 ( http://i30.tinypic.com/2942q80.png )

    — commented July 28th 2010 by Michael Descher

6 Answers

  • Accepted Answer

    There seems to be a known bug introduced with 1.4.0. Add a "className" attribute to the TableViewRow and it should work.

    — answered July 29th 2010 by Brandon Kenna
    permalink
    0 Comments
  • I can confirm this.

    — answered July 28th 2010 by Dan Tamas
    permalink
    0 Comments
  • Yes, this is what is happening to me too.

    I have higher rows than it should be and empty.

    If I scroll a little,the data appears.

    — answered July 28th 2010 by Dan Tamas
    permalink
    0 Comments
  • Same problem here guys. Have also submitted a support ticket with our Premium subscription about this problem. Hopefully we'll have answers soon.

    — answered July 28th 2010 by Brandon Kenna
    permalink
    0 Comments
  • @Brandon I have classNames on all my tables, no matter how they big they are. It's the way I code.

    — answered July 29th 2010 by Dan Tamas
    permalink
    1 Comment
    • Ok Tamas. I was looking at Michael's code hoping it would help his issue, as I had the same problem and it solved it for me. Can you drop an example of your code on pastie.org?

      — commented July 29th 2010 by Brandon Kenna
  • duplicate

    — answered July 29th 2010 by Dan Tamas
    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.