FLEX4.0 Displays the list information using the external item display and adds a picture sample _flex

Source: Internet
Author: User
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.