3 Replies Latest reply on Nov 20, 2009 6:27 AM by Gregory Lafrance

    HDivided box showing unwanted scrollbars

    michael nieuwenhuizen

      Hello, I have a Flex app with the following structure:

       

      <mx:VBox width="100%" height="100%">
           <mx:MenuBar />
           <mx:HBox width="100%" height="100%" >
                <mx:VBox height="100%" width="50%">

                     <!-- more children here -->
                </mx:VBox>
                <mx:VBox width="50%" height="100%">
                     <!-- more children here -->
                </mx:VBox>
           </mx:HBox>       
      </mx:VBox>

       

      which does just what I want: there's a menubar, and the space below is divided in 2, taking up the whole screen, but no scrolling

       

      Now if I replace the HBox tag with a HDividedBox tag, I suddenly get scrollbars.  Any idea why that happens?  I've tried setting the horizontal- and verticalScrollingPolicy to "off" but that doesn't help either.

        • 1. Re: HDivided box showing unwanted scrollbars
          Flex harUI Adobe Employee

          HDividedBox should respect scrollPolicy.  Maybe it is forcing the child to show its scrollbars.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: HDivided box showing unwanted scrollbars
            michael nieuwenhuizen Level 1

            I've taken the outer VBox away, such that the structure is like below, and the HDividedBox is the first child of the Application:

             

            <mx:HDividedBox width="100%" height="100%" verticalScrollPolicy="off" horizontalScrollPolicy="off">

                 <mx:VBox height="100%" width="50%">

                      <!-- child elements here -->

                  </mx:VBox>

                 <mx:VBox width="50%" height="100%">

                 </mx:VBox>

                      <!-- child elements here -->

                 </mx:VBox>

            </mx:HDividedBox>   

             

            but there is still a vertical scrollbar (that also causes a small horizontal scroll bar tio appear).

            • 3. Re: HDivided box showing unwanted scrollbars
              Gregory Lafrance Level 6

              The following renders fine. Maybe you need to set some width and height properties in children to 100%.

               

              Its always best in these cases if you post simplified yet complete code so we can actually see the issue.

               

              Taes time, but as you boil down the code you often solve the issue.

               

              If this post answers your question or helps, please mark it as such.

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
                <mx:HDividedBox width="100%" height="100%"
                  verticalScrollPolicy="off" horizontalScrollPolicy="off">
                  <mx:VBox height="100%" width="50%">
                    <mx:Canvas width="100%" height="100%" backgroundColor="0xFF0000"/>
                  </mx:VBox>
                  <mx:VBox width="50%" height="100%">
                    <mx:Canvas width="100%" height="100%" backgroundColor="0xFF00FF"/>
                  </mx:VBox>
                </mx:HDividedBox> 
              </mx:Application>