Titanium Community Questions & Answer Archive

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

Feature request: numbered disclosure indicator

Hi there,

In an iPhone tableview I have a need to display the number of rows in a child tableview. In some apple iphone apps there is a numbered disclosure indicator (grey lozenge, with white number) which would be perfect.

I was considering whether to draw this with a label & background png, but since the number could be 1, 11 or even 111, the size of the background could change making centering the text very fiddly.

Would it be possible to add a 'numbered disclosure indicator' alongside 'hasDetail' and 'hasChild' for a tableViewRow, with ablity to set integer value - like badge for tabs, would be ideal.


— asked March 30th 2010 by Chris Reed
  • disclosuree
  • feature
  • iphone
  • tableview

2 Answers

  • Accepted Answer

    Hi Chris

    Check out this thread for an example using a custom view.

    If you add a label with textAlign:'center' and specify width:auto on both objects there shouldn't be any fiddly size problems.

    Hope that helps.

    — answered March 30th 2010 by James K
  • Hi James,

    Great one. I didn't spot that the label had a borderRadius property.

    I'd only thought about using a tiny view but guessed that might be a performance if there were quite a few rows.

    Many thanks,

    — answered March 30th 2010 by Chris Reed
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.