简体   繁体   中英

Scroller not resizing

My group component lying inside main application, can change height from 340 to 300 without spoiling the layout. So I set minHeight to 300.

Now if application is resized below the height of 700, this group start spoiling the layout (as it stop reducing in the size as expected).

As a solution I added Scroller control around the group so that scrollbars appear after size goes lower than the scroller control continues to reduce in size. The code for the scroller control is as below:

<s:Scroller id="scrlAnswer" top="220" 
            bottom="55" x="0" width="600">
    <s:Group id="grpAnswers" x="0" y="0" minHeight="300" height="340" width="600">

But the problem is Scroller is not resizing with application.

So my question is is there some other parameter I need to set to make scroller change its size? Is there any other control in Flex for this situation?

=== UPDATE ==== Added resize event to the parent of the scroller control, there manually changed the size of the scroller. Even though the size changed in code but acutual size on screen do not seem to change.

protected function bcMain_resizeHandler(event:ResizeEvent):void
            {
                scrlAnswer.height = event.target.height* 338/609;
                trace("Main:"+event.target.height);

                trace("Scroller: "+scrlAnswer.height);



            }

Finally figured out the issue. I need to declare the height of the internal group to 100% not a fixed number.

<s:Group id="grpAnswers" x="0" y="0" height="100%" width="600">

The resize event on the scroller is not required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM