2012-07-09 90 views

回答

5

您不能:VGroup是一個佈局容器。它不包含圖形元素。
閱讀回答有關佈局容器多一點信息:Add layout to Flex UIComponent

您的問題,最簡單的方法,如果你不想碰在Vgroup,會是這樣的:

<s:Group> 
    <s:Rect left="0" right="0" top="0" bottom="0"> 
     <s:fill> 
      <s:SolidColor color="0x000000" /> 
     </s:fill> 
    </s:Rect> 

    <s:VGroup left="0" right="0" top="0" bottom="0"> 
     <!--content goes here--> 
    </s:VGroup> 
</s:Group> 

但你也可以使用BorderContainer代替:

<s:BorderContainer backgroundColor="black"> 
    <s:layout> 
     <s:VerticalLayout /> 
    </s:layout> 

    <!--content goes here--> 
</s:BorderContainer> 
+2

雖然我使用'BorderContainer'時,沒有發現任何性能問題,Adobe公司建議不要在自一個PRET移動應用程序中使用它ty重組分。 – AlBirdie 2012-07-09 10:46:20