【发布时间】:2012-04-26 08:44:47
【问题描述】:
我在 Flex 中创建了一个自定义组件,扩展了 BorderContainer 类,我希望能够在我的主应用程序中使用它时在标签集中放置其他内容,如下所示:
<components:CustomComponent title="Hello">
<s:Label text="If you have one enter it below:"/>
<mx:Spacer height="15" />
<s:HGroup>
<s:TextInput width="250"/>
<s:Button label="Submit"/>
</s:HGroup>
</components:CustomComponent>
这很好用,只是我的组件定义里面有一些额外的东西,比如<s:Label/> 和样式,当我去使用它时,它会被上面标签集中的内容替换。
如果我没有在标签集中放置任何内容,则不会替换原来在组件中的内容。
有没有一种方法可以让我在使用组件时简单地在组件内附加额外的内容,而不是每次都替换它?
感谢您的宝贵时间!
【问题讨论】:
标签: flash apache-flex air components custom-component