3 Replies Latest reply on Aug 26, 2009 12:03 PM by Dharmesh Chheda

    adjust Application height

    Dharmesh Chheda


         I am adding child components to the viewstack which increase its height .. how do i resize the Application as a whole as and when the height increases. Tried .. verticalScrollPolicy, % height etc .. no luck yet..





        • 1. Re: adjust Application height
          Gregory Lafrance Level 6

          Setting application width and height to 100% usually does it.


          You may need to boil your code to simplified yet complete example code and post here so we can see exactly what you are doing.

          • 2. Re: adjust Application height
            Dharmesh Chheda Level 1

            Hi Greg


                 Here is the explanation.. When the page loads, I have a blank view stack.. but as the session progresses, the user can add components to the view stack which will increase the height of the viewstack component.


            I use ActionScript to add the child components to the selected child container of the view stack ..


            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" backgroundColor="0xFFFFFF" verticalScrollPolicy="on"    
                xmlns:mconnect="com.*" creationComplete="initPage()" height="100%">







                <mconnect:CoverageTabNavigator id="coverageViewStack" tabPosition="leftTop"  name="coverageViewStack"
                            tabWidth="200" tabHeight="50"  width="900" height="500" paddingLeft="0" paddingTop="0" x="20" y="377">




            When the application is loaded, it is of the correct length i.e. it considers the height of the viewstack as 500 and adjusts accordingly .. but the moment the height crosses 500, it just does not stretch to that height...


            any tips?

            • 3. Re: adjust Application height
              Dharmesh Chheda Level 1

              Hi .. in case anyone is instersted, I was able to resolve this issue.



              First-> I wrapped my application under a new container (Canvas in this case).


              Second-> I give the height of the viewStack as 0 in the main mxml file. I keep hold of the height of the canvas container once the page is redrawn. i.e. in the creation complete listener of my custom view stack.


              Third-> In the layoutChrome method of the custom ViewStack component, I grab the children of  the selected tab container and total up all the heights for the children and assign that value as the height of the viewStack. Also I add the total calculated to the original canvas height .. so that now the canvas assumes the new height.


              Fourth-> I have also overridden the contentHeight method to the ViewStack to consider the children height.