Well, first, you are specifying that the two panels take up  a total of
100% of the app height, so what you describe is what you are asking for.

 

You can use an expression in binding braces. Try this, see if it does
what you want:

<mx:Panel height="{this.height/4}">

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Keith Hughitt
Sent: Friday, February 20, 2009 11:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Relative Layout Question

 

Hi all,

I have a question about using creative relatively-sized layouts:

The default behavior
<http://livedocs.adobe.com/flex/3/langref/mx/containers/Panel.html>
of many containers is to use adopt a height just large enough to fit all
of it's children content. Manually specifying a relative height (e.g.
25%) for the container will work, but only if the content is small
enough. Otherwise the height is increased to fit the content.

e.g.

        <?xml version="1.0" encoding="utf-8"?>
        <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical" width="600" height="600">
            <mx:Panel height="75%">
                <mx:Text text="This panel should take up 75% of the
application's height" />
            </mx:Panel>
            <mx:Panel height="25%">
                <mx:Accordion>
                    <mx:Form>
                        <mx:Text text="Item 1" />
                        <mx:Text text="Item 2" />
                        <mx:Text text="Item 3" />
                        <mx:Text text="Item 4" />
                    </mx:Form>
                    <mx:Form>
                        <mx:Text text="etc" />
                    </mx:Form>
                </mx:Accordion>        
            </mx:Panel>
        </mx:Application>

Instead of taking up 25% of the application height the bottom panel will
expand to fit the accordion (which in turn has a height equal to the
amount of space used up by it's larged child).

Is there anyway I can force the panel to only expand to 25% of the main
application's height? I can set an absolute height the panel's children
which will assure a maximum height, but I would like to be able to use a
relative height.

Any ideas? Any suggestions would be greatly appreciated.

Thanks!
Keith



Reply via email to