0

How can I set the maximum vertical scroll height? I mean the scroller contains 100 items (let's say) and i want to scroll down only on few of these items (from 0th - 30th). possible?

zero323
  • 322,348
  • 103
  • 959
  • 935
hassicho
  • 99
  • 8
  • What is the point of adding the remaining objects to the container if the user cannot see them? What is your `Scroller` wrapping a `List` control or one of the Flex containers? If it's a container, and you're not going to show elements 31-100, then those elements are consuming memory (and the cpu cycles to create them) unnecessarily ;) – Sunil D. Jun 01 '13 at 06:55
  • there are times where all the 100 items (they are labels) are displayed actually. But i've tried to add them dynamically based on the user and it takes several seconds to do so. I just statically added them to the container but making them invisible for the user unless he requested all items – hassicho Jun 01 '13 at 07:01
  • Thanks for explaining! If you are making them invisible (`visible=false`), then you can also set the `includeInLayout` property to false as well. This property tells the parent container whether to allocate space for the given object. I think that will fix the issue... – Sunil D. Jun 01 '13 at 07:05

1 Answers1

0

Providing a formal answer, based on the comments... and some additional info.

The Scroller class doesn't have any properties or means of restricting how far you can scroll. To do that, you would have to sub class the Scroller component and add that behavior.

However, after the OP described the issue further, it became clear that the elements he didn't want to scroll to were being made invisible.

When making something invisible in Flex, it is a common practice to also set the object's includeInLayout property to false as well.

The includeInLayout property tells the layout class (when using Flex 4) or the parent container class (when using Flex 3) whether it should allocate space for the object when layout the child elements.

Sunil D.
  • 17,983
  • 6
  • 53
  • 65