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 auto height property doesnt work / bug?


I have a scrollView inside a window.
To this scrollView I will add 3 views, all with variable heights.
When I set the height of the scrollView to 'auto' it will never scroll and show the views that are outside the windowview.
However, if I add a height of, for example, 500 to it, it will show me the views outside the scope of the windows' height.

What am I doing wrong? Is this a bug?

— asked September 10th 2010 by Jeroen Kntl
  • height
  • scrollview

3 Answers

  • Got it, the height should just be 460 if you want it to fit in the bounding box of the whole window. That makes sense :)

    — answered September 10th 2010 by Jeroen Kntl
  • Try to use

    myScrollView.contentHeight = 'auto';

    — answered September 10th 2010 by Jean-Sebastien GALLOO
  • By setting a set height and width of the content I'm adding the the scrollview and not setting dimensions for the scrollview, I was able to get it to display correctly.

    I used Ti.Platform.displayCaps.platformHeight and platformWidth for the dimensions of my added content, a tableview in my case. You can turn these into percentages by multiplying them by a float number between 0 and 1.

    Setting the scrollview dimensions without setting tableview dimensions caused it to shrink to odd dimensions and not display right. (This is on TiMobile 1.6.1 and Android 1.6)

    This comment was also posted here.

    — answered April 4th 2011 by Joe iEntry
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.