我正在尝试使用提供来自 xml 的数据的图像创建一个列表,但是当我运行它时......列表是空的!
请帮我!
这是我的代码的一部分:
主要.mxml:
<s:List bottom="15" width="50%" height="20%" dragEnabled="true" horizontalCenter="-2"
horizontalScrollPolicy="on" itemRenderer="hListItemRenderer">
<s:dataProvider>
<s:XMLListCollection source="{gallery.children()}"/>
</s:dataProvider>
</s:List>
项目渲染器.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
autoLayout="true">
<s:Image source="{data.children()}" />
</s:ItemRenderer>
画廊.xml:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/03/08/creating-a-simple-image-gallery-with-the-flex-tilelist-control/ -->
<gallery>
<image img="assets/wheelchair0.jpg"/>
<image
img="assets/10275402-icono-de-la-television-tv-reciclado-papel-palo-sobre-fondo-de-color-de-pantalla-retro-grunge.jpg" />
</gallery>
</xml>
米伦谢谢!!