1 Reply Latest reply on Sep 30, 2010 12:26 PM by Lee Bock

    Sizing problem with child BorderContainers

    Tim John Level 1

      Hi,

       

      This was going to be a question, but in writing I have discovered the answer. Take this example:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark" 
                        xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
           <s:Group height="50">
                <s:BorderContainer height="100%"/>
           </s:Group>
      </s:Application>
      

       

      You may be surprised to see that when rendered, the BorderContainer is larger than its parent despite being explicitly set at 100% height. 112 pixels to be precise.

       

      Well, this is because BorderContainer's default properties include a minWidth and minHeight of 112 pixels, so if you want total flexibility, set these values to 0.

       

      I hope others with the same infuriating problem will benefit from this post!

       

      Tim