我有一个要使用TileList显示的关联数组。然而,它并不理解被喂给它的是什么。我得到的只是TileList中的对象。
[bindable]
public var people as array = new array();
private function loadArray():void{
people = decoded JSON array
showPeople.dataProvider = people;}
<mx:Tilelist id="showPeople" labelField="{data.name}" iconField="{data.imgURL}"/>我尝试使用mx:itemRender,但它只能呈现一个项目,即人名的字符串或url的图像。最终目标是让TileList使用数组中的URL和他们的名字作为标签来显示一个人的图片。有什么建议吗?
该数组看起来像是人名的' name‘=>字符串img的=>字符串img URL
发布于 2010-04-08 13:54:00
您应该使用自定义项目渲染器,如下所示:
<mx:itemRenderer>
<mx:Component>
<mx:HBox>
<mx:Text width="100" height="100" text="{data.name}"/>
<mx:Image width="100" height="100" source="{data.imgURL}"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
通过这种方式,您可以根据需要自定义列表项。
https://stackoverflow.com/questions/2596327
复制相似问题