0
votes

I am creating one application. In that There is one popup, in that I had used one VGroup in one Scroller.

I am dynamically adding my custom components in VGroup and removing all components at the closing of the popup and saves those components in Memory Pool.

In First step, I open a popup with numbers of components by that scroll bar appears. Then I close the popup.

In second step, I opens a same popup instance with some less components so scroll bar does not appears and close the popup.

And now when I open popup with more components again scrollbar not appears. So whenever popup is once opend with less components, scrollbar disappears.

Pls help me...

Here is the full code :

<s:Scroller id="myScroller"
        width="100%"
        height="210"
        horizontalScrollPolicy="off">
    <s:VGroup id="myContainer"
         width="100%"
         height="210" />
</s:Scroller>

Code for Adding Components :

for each(var object:MyObject in _arr)
{
    var newView:MyCustomView = MyCustomViewPool.acquire();
    myContainer.addElementAt(newView, 0);
    newView.myData = object;
}

Here is the code for removing components :

for(var i:int = 0; i < myContainer.numElements; i++)
{
    var newViewElement:IVisualElement = myContainer.getElementAt(i);
    var myViewComponent:MyCustomView = newViewElement as MyCustomView;
    MyCustomViewPool.release(myViewComponent);

}
myContainer.removeAllElements();
1

1 Answers

0
votes

I think you don't have to set the hight on the VGroup. Just remove the assignment.