带有关联数组的 Flex TileList
我有一个关联数组,我想使用 TileList 显示它。然而,它不明白喂给它的是什么。我得到的只是 TileList 中的 [object]。
[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 但它只会渲染一项且仅一项,即人名字符串或网址图像。最终目标是让 TileList 使用数组中的 URL 以及人名作为标签来显示人的图片。有什么建议吗?
数组看起来像这样 '名字' =>人名字符串 'img'=>图片 URL 的字符串
I have an associative array that I want to display using TileList. However, it doesn't understand what is being fed to it. All I got is [object] in the 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}"/>
I tried using the mx:itemRender but it will only render one and only one item, ie either the string of the person's name or the image of the url. The end goal is to have the TileList show a person's picture using the URL from the array along with their name as the label. Any suggestion?
And the array looks like this
'name' => string of a person's name
'img' => string of the img URL
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用自定义项目渲染器,如下所示:
通过这种方式,您可以根据需要自定义列表项。
You should use a custom item renderer, like this one:
In this way you can customize your list items as you wish.