Ti 2.0.1 - Multiline Label in ScrollView

You must Login before you can answer or comment on any questions.

Hello. I recently downloaded the Titanium 2.0.1 Mobile SDK, and I had one /major/ issue with it.
In the previous versions, I could add a multiline label with its height set to 'auto' in a scrollview, and so it filled the scrollview on its entire height and I could just scroll to see the entire text.
Now, it seems I'm not able to do this anymore, probably because of the new layout system. If you need any screenshots to understand the situation, just ask!

— asked 1 year ago by Baptiste Candellier
2 Comments
  • Hello Baptiste,

    Please show me screenshots, so i can understand the situation...

    — commented 1 year ago by Ritesh .

  • How it looks like on 2.0.1: http://d.pr/i/kj9e
    I wanted to take a screenshot on 1.8.2 to compare, but it looks like I can't because I upgraded Xcode, so here's a video of the app instead (start at 2:10).
    As you can see, the text you're seeing on the screenshot should not be stopping at the ellipsis; there are like 3 more lines that don't appear, and that's my problem.

    — commented 1 year ago by Baptiste Candellier

3 Answers

I just found a simple hack for this, just add "\n " (with a space) at the end of the label and it will be completely visible in the ScrollView.

Change height:'auto' to height:Ti.UI.SIZE

see : http://developer.appcelerator.com/blog/2012/04/layout-changes-for-2-0.html

— answered 1 year ago by Kosso .
answer permalink
1 Comment
  • Doesn't really help.
    1. When I set the contentHeight of the scrollview to Ti.UI.SIZE, it just makes the scrollview non-scrollable;
    2. When I set the height of the label to Ti.UI.SIZE, it doesn't change anything;
    3. When I change both, it does the same as 1.

    — commented 1 year ago by Baptiste Candellier

I found this guide, but it doesn't solve anything, as Ti.UI.FILL only vertically centers the label in the scrollview and it seems there's no alternative.

Your Answer

Think you can help? Login to answer this question!