Adobe Flex / AIR: Scrolling a subcomponent, not the entire window

I am developing an application with Adobe Flex and AIR, and I hit my head against a wall, trying to figure out how to solve the scroll problem.

The basic structure of my main application window (simplified):

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
   paddingTop="0" paddingRight="0" paddingBottom="0" paddingLeft="0"
   width="800" height="600" layout="vertical" verticalAlign="top" 
>
   <mx:VBox id="MainContainer" width="100%" height="100%">
      <mx:Panel id="Toolbars" width="100%" height="25" />
      <mx:HDividedBox width="100%" height="100%" >
         <mx:Panel id="Navigation" minWidth="200" height="100%" />
         <mx:VBox id="MainContent" width="100%">
            <mx:Panel width="100%" height="200" />
            <mx:Panel width="100%" height="200" />
            <mx:Panel width="100%" height="200" />
            <mx:Panel width="100%" height="200" />
            <mx:Panel width="100%" height="200" />
         </mx:VBox>
         <mx:Panel id="HelpContent" minWidth="200" height="100%" />
      </mx:HDividedBox>
      <mx:Panel id="FooterContent" width="100%" height="25" />
   </mx:VBox>
</mx:WindowedApplication>

The problem is that the “MainContent” field can contain a huge list of subcomponents, and having this long list causes the vertical scroll bar to be displayed at the highest level of the graphical interface surrounding the vbox of the main device.

It looks really stupid, having scroll bars around the entire application window.

, , - , vbox ( Navigation HelpContent, ).

StackOverflow, autoLayout "verticalScrollPolicy" .

, autoLayout = "false" verticalScrollPolicy = "off" , verticalScrollPolicy = "on" vbox . , ( MainContent vbox ​​ ).

- , ?

+5
4
+1

HBox VBox . ( ) , , , .

HBox VBox MinWidth measuredMinHeight measure() , . , .

hasseg solution , , . , . , , minWidth minHeight 0. MinWidth measuredMinHeight , - .

+6

, . : measure() Box.

, " ". .

package whatever
{
    import mx.containers.Box;

    /**
    * A Box that has no measure() implementation.
    * 
    * <p>
    * See http://old.nabble.com/-flex_india%3A3318--Size-layout-issues-with-respect-to-parent-containers-to12882767.html
   *  for more info.
    * </p>
    */
    public class NonMeasuredBox extends Box
    {
        /**
        * Constructor
        */
        public function NonMeasuredBox():void
        {
            super();
        }

        override protected function measure():void { /* disabled */ }
    }
}
0

, VBox , minHeight VBox, , 0.

0

All Articles