2011-11-30 32 views
0

我有一個名爲'GroupNavCustomContainer'的SkinnableContainer類,它使用名爲'GroupNavCustomSkin'的skinClass。 GroupNavCustomSkin是Flex爲您創建的默認一個:(Spark SkinnableContainer容器的默認外觀類)。現在,我必須從類外部動態地向GroupNavCustomContainer添加按鈕,這不是問題。但是,我似乎無法想出讓我的皮膚像HGroup一樣行動,所以按鈕間距均勻。我想: 修改組容器無濟於事:將SkinnableContainer作爲HGroup?

<!-- 
    Note: setting the minimum size to 0 here so that changes to the host component's 
    size will not be thwarted by this skin part's minimum size. This is a compromise, 
    more about it here: http://bugs.adobe.com/jira/browse/SDK-21143 
--> 
<!--- @copy spark.components.SkinnableContainer#contentGroup --> 
<s:HGroup > 

</s:HGroup> 

我是相當新的Flex的4.6,所以我相信我在這裏缺少一個關鍵概念。

回答

0

啊,想通了!水平佈局連同填充。我希望有一些關於Flex Spark皮膚的權威指南...

<!-- 
     Note: setting the minimum size to 0 here so that changes to the host component's 
     size will not be thwarted by this skin part's minimum size. This is a compromise, 
     more about it here: http://bugs.adobe.com/jira/browse/SDK-21143 
    --> 
    <!--- @copy spark.components.SkinnableContainer#contentGroup --> 
    <s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" minWidth="475" minHeight="0"> 
     <s:layout> 

      <s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="7" paddingBottom="7" gap="10" /> 

     </s:layout> 
    </s:Group>