问题:
如果我在Repeater中使用NavigatorContent,则会出现以下错误。有没有办法初始化我遇到错误的图像和标签:
无法生成初始化代码 在Repeater中,由于id或数据 绑定在不是的组件上 视觉孩子。
代码:
<mx:Repeater id="rep" dataProvider="{usersArray}">
<s:NavigatorContent width="100%" height="100%" label="{rep.currentItem.name}" >
<mx:Image x="10" y="10" source="{rep.currentItem.imagePath}" width="175" height="118"/>
<s:Label x="145" y="14" text="{rep.currentItem.name}"/>
<s:Button x="147" y="79" label="Edit User" width="79" height="22" click="currentState='AddUser'"/>
<s:Button x="231" y="79" label="Delete" width="56" height="22"/>
</s:NavigatorContent>
</mx:Repeater>
答案 0 :(得分:0)
来自文档:
NavigatorContent类定义了一个 可用于的火花容器 MX导航器容器,如 ViewStack,TabNavigator和Accordion 容器
不要使用NavigatorContent MX导航器外部的容器 容器
我想您会想要在Repeater中使用Canvas或自定义组件。或者您可以使用DataGroup而不是Repeater。
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/DataGroup.html