Titanium Community Questions & Answer Archive

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

textAlign:'center' causing 'top' to not work?

Whenever I use the property

textAlign:'center'

In a label, it causes my 'top' property to go all wonky. I think that "textAlign:center" causes the label to be directly fixed to the center of the page no matter what, instead of just centering the text?

Could this be fixed, or clarified if I don't understand it? Cause right now I have to set textAlign and then set the position using left, right, and bottom, which is quite… Uncool.

— asked October 16th 2010 by Colton Arabsky
  • label
  • textalign
0 Comments

2 Answers

  • if you place it in a view then it should work. Make sure to define height as well.

    — answered October 16th 2010 by Duncan Kabinu
    permalink
    0 Comments
  • I have exactly the same problem, described here in the answer: http://developer.appcelerator.com/question/70821/make-the-whole-window-scrollable

    I put the textAlign:center into the view -> the text isn't aligned at all and still appears in the middle of the view.

    — answered October 19th 2010 by Feyyaz Alingan
    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.