I want to display a list of dynamically generated images. I am trying to use an IconItemRenderer, however, I cannot figure out how to display the image (a spark.components.Image) in the IconItemRenderer.
I have tried the following:
iir.iconContentLoader = image.contentLoader;
But this did not work. The image is correct, when I use addElement(image) instead, it works.
So, how can I add a dynamic image to an IconItemRenderer?
You could try using the iconFunction property in the iconItemRenderer class as follows:
iir.iconFunction = getImage;
...
private function getImage(item:Object):* {
return image.contentLoader;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.