Titanium Community Questions & Answer Archive

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

align text vertically in a label

The title says it all, this should be easy but I can't seem to find any attribute that will place the text at the top of a 300px high label, it just sits right in the middle. Thanks!

— asked April 23rd 2010 by Russell Morgan
  • align
  • label
  • text

4 Answers

  • Why not just use height: 'auto'? That should produce the same behavior. Are you placing another view inside the label?

    — answered April 23rd 2010 by Nick Wing
  • This is context of a tablerow. I had set the label to be height auto but as the table scrolled the label in question would randomly place itself over other labels. I guess the bigger question I'm trying to answer is this: How do I have three labels stack on top of each other in a table row and all three expand to fit their contents without overlapping. I believe I tried "auto" on all three and got terrible results.

    — answered April 24th 2010 by Russell Morgan
    1 Comment
    • Also having a similar problem… did you ever figure this out?

      — commented January 3rd 2011 by Dave F
  • Nick's suggestion is correct.
    I can confirm that setting height:'auto' on the label will align the text vertically. Worked for me on 1.5.1

    — answered February 8th 2011 by Daniel Tome
  • it worked for me too.

    — answered July 14th 2011 by Bruno Braga
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.