apache-flex Flex可换肤容器作为H组?

2sbarzqh  于 2022-11-01  发布在  Apache
关注(0)|答案(1)|浏览(146)

我有一个SkinnableContainer类,名为:使用名为“GroupNavCustomSkin”的皮肤类的“GroupNavCustomContainer”。GroupNavCustomSkin是Flex为您创建的默认皮肤:(Spark SkinnableContainer容器的默认皮肤类)。现在,我必须从类的外部动态地向GroupNavCustomContainer添加按钮,这不是问题。但是,我似乎不知道如何使我的皮肤表现为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的新手,所以我肯定我在这里遗漏了一个关键概念。

wfsdck30

wfsdck301#

啊,想通了!水平布局结合填充。我希望有一些关于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>

相关问题