Titanium Community Questions & Answer Archive

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

scrollView + textAlign: center - doesn't work

I set up the height of the view to 2500, integrated a label and put everything into a scrollView. However, the text shows in the middle of the whole view and not from the top on. How can I change that?

The code: http://pastie.org/1252316

I'd appreciate any help.

— asked October 27th 2010 by Feyyaz Alingan
  • iphone
  • label
  • scrollview
  • view
0 Comments

1 Answer

  • Accepted Answer

    Set the top and the height of the label like this:

    var l1 = Ti.UI.createLabel({
        font:{fontSize:24},
        text:text1,
        textAlign:'center',
        top:0,
        height:'auto'
    });
    
    — answered October 27th 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.