2010-02-19 19 views
0

無論我放在「瀏覽」按鈕的horizo​​ntalCenter屬性中的值如何,它只是跟在VGroup的horizo​​ntalAlign屬性之後。這是爲什麼 ?horizo​​ntalCenter參數在flex中丟棄4 vgroup

由於

<s:Group width="100%" height="100%" left="0" right="0" top="0" bottom="0"> 
    <s:Panel id="mainPanel" title="File uploader" width="75%" height="75%" horizontalCenter="0" verticalCenter="0"> 
     <s:controlBarContent> <s:Label text="foo"/> </s:controlBarContent> 
     <mx:HDividedBox width="100%" height="100%"> 
      <s:VGroup width="25%" height="100%" paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10"> 
       <s:TextArea width="100%" height="100%" /> 
       <s:Button label="Browse" horizontalCenter="30"/> 
      </s:VGroup> 
      <s:TextArea width="100%" height="100%" /> 
     </mx:HDividedBox> 
    </s:Panel> 
</s:Group> 

回答

3

在Vgroup Flex 4中使用spark.layouts.VerticalLayout不考慮horizo​​ntalCenter/verticalCenter:/。我自己不喜歡那樣。

但由於您的VGroup的子文本區域是100%寬度/高度,因此您可以使用VerticalLayout/VGroup horizontalAlign屬性:horizontalAlign="center"。這一工程:

<s:Group width="100%" height="100%" left="0" right="0" top="0" bottom="0"> 
    <s:Panel id="mainPanel" title="File uploader" width="75%" height="75%" horizontalCenter="0" verticalCenter="0"> 
     <s:controlBarContent> 
      <s:Label text="foo"/> 
     </s:controlBarContent> 
     <mx:HDividedBox width="100%" height="100%"> 
      <s:VGroup width="25%" height="100%" paddingLeft="10" horizontalAlign="center" paddingRight="10" paddingTop="10" paddingBottom="10"> 
       <s:TextArea width="100%" height="100%" /> 
       <s:Button label="Browse" horizontalCenter="30"/> 
      </s:VGroup> 
      <s:TextArea width="100%" height="100%" /> 
     </mx:HDividedBox> 
    </s:Panel> 
</s:Group>