The first is the external item Profiler file:
Copy Code code as follows:
<?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"
Autodrawbackground= "true" >
<s:Group>
<s:layout>
<s:horizontallayout paddingleft= "paddingtop=" "gap=" verticalalign= "Middle"/>
</s:layout>
<fx:Script>
<! [cdata[
[Embed (source= "Images/user_superman.png")]
Private Const Imgsource:class;
Private Function GetImage (data:object): Object
{
if (data!=null)
{
var img:image=new Image ();
Img.source=imgsource;
This.addelement (IMG);
}
return null;
}
]]>
</fx:Script>
<s:image source= "{getImage (This.data)}"/>
<s:label text= "{data.sname}+ ' * * * * +{data.sage}"/>
</s:Group>
</s:ItemRenderer>
The second part is to refer to the application main file:
Copy Code code as follows:
<s:list id= "stulist" width= "100%" height= "100%" dataprovider= "{stucoll}" itemrenderer= "Com.hz.StuListItemRender" >
</s:List>
The display effect is as follows: