1
我制作了一个基于MenuBar的自定义组件。这是密码Flex自定义组件问题
<?xml version="1.0" encoding="utf-8"?>
<mx:MenuBar xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
labelField="@label">
<mx:XMLList>
<menuitem label="Website" />
</mx:XMLList>
</mx:MenuBar>
问题是“网站”不显示。
编辑
我找到了正确的语法,它的工作现在
<?xml version="1.0" encoding="utf-8"?>
<mx:MenuBar xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%"
labelField="@label" dataProvider="{menuXmlListCollection}">
<mx:XMLListCollection id="menuXmlListCollection">
<mx:XMLList>
<menuitem label="Website" />
</mx:XMLList>
</mx:XMLListCollection>
</mx:MenuBar>