Titanium Community Questions & Answer Archive

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

I just want to layout a simple table view including a few labels and and image. How hard can it be?

I'm trying to do a tableview on iPhone, in which I have text of an arbitrary length, split into several different labels, next to an image on the left. And I want each row to be uniformly padded at the top and bottom.

My current container hierarchy is thus:

win
-tableview
--tableviewrow
---imageview
---view (layout:vertical, height:auto)
----label
----label
----label

All my labels are height:auto, width:auto, left:0. Nothing else specified.

The problem occurs if I use top/bottom attributes to get the same top/bottom padding in the view which containing the labels.

I'm guessing its some combination of top, bottom, minrowheight, layout etc on either the row, the view or the table (The sheer number of permutations to get it right should probably indicate to the developers that something needs documenting!!)

I can't find a single Q&A which satisfactorily explains what attributes I should be using and in what quantities, which is perplexing as I'd have though presenting a simple table with thumbnails is iphone 101. Is it really that hard to do right?

Thanks in advance for anyone able to contribute.

— asked August 17th 2010 by David Cranwell
  • imageview
  • iphone
  • layout
  • row
  • tableview
  • vertical
  • view
0 Comments

2 Answers

  • Hi David.
    You could try to avoid using "auto". Sometimes ( and it seems in your case it happens) the calculations are not done right.
    Could you use pastie to provide some code to see what's there, maybe we'll find a way :)

    — answered August 17th 2010 by Dan Tamas
    permalink
    0 Comments
  • hi,

    please check this pastie & inform me if u have any douts still

    http://www.pastie.org/1099675

    Thks & regards…

    — answered August 18th 2010 by Varun Atluri
    permalink
    1 Comment
    • The example you posted only shows a single label being added to a row. The question is how to have three labels flow one after the other in a dynamically sized row. Do you have an example of how to do that?

      — commented August 30th 2010 by Aaron Wheeler
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.