2012-04-17 8 views

答えて

0

あなたは3 BorderContainersがあなたのVGroupコンテナの同じ量を取るしたい場合は、次のようなものを試してみてください。

<s:VGroup width="100%" height="100%"> 
    <s:BorderContainer width="100%" height="33%"> 
     ... 
    </s:BorderContainer> 
    <s:BorderContainer width="100%" height="33%"> 
     ... 
    </s:BorderContainer> 
    <s:BorderContainer width="100%" height="33%"> 
     ... 
    </s:BorderContainer> 
</s:VGroup> 

また、Actionscriptで宣言している場合は、

var b:BorderContainer = new BorderContainer(); 
... 
b.percentWidth = 100; 
b.percentHeight = 33; 

などのコードの下に

+0

3つのボーダーコンテナの高さが異なるため不可能です。私は3の間のスペースが必要ですが同じですが、私はそれぞれが33%の高さであると判断することはできません。ありがとう – Flex60460

0

実装するためにいくつかのアイデアを与える可能性があります - あなたは、コンテナのための動的な高さを得ることができるよう あなたは要件ごとに、あなたのロジックを変更することができます.....

<?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" > 
    <fx:Declarations> 
     <!-- Place non-visual elements (e.g., services, value objects) here --> 
    </fx:Declarations> 
    <fx:Script> 
     <![CDATA[ 

      private var heightArray:Array = new Array(200,800,400); 
//dynamic array created at run time 
      private function calculateHeight():void 
      { 
       var totalHeight:Number = heightArray[0]+heightArray[1]+heightArray[2]; 
       //for more values in array use for loop as per user specification 
       container1.percentHeight = (heightArray[0]/totalHeight) * 100; 
       container2.percentHeight = (heightArray[1]/totalHeight) * 100; 
       container3.percentHeight = (heightArray[2]/totalHeight) * 100; 
      } 

     ]]> 
    </fx:Script> 
    <s:VGroup width="100%" height="100%" creationComplete="calculateHeight()"> 
     <s:BorderContainer id="container1" width="100%" > 
     </s:BorderContainer> 
     <s:BorderContainer id="container2" width="100%" > 
     </s:BorderContainer> 
     <s:BorderContainer id="container3" width="100%" > 
     </s:BorderContainer> 
    </s:VGroup> 

</s:Application> 
関連する問題