Posted By

GunnarHKarlsson on 10/06/11


Tagged


Versions (?)

itemrenderer with icon


 / Published in: MXML
 

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
  3. xmlns:s="library://ns.adobe.com/flex/spark" height="100" width="100%">
  4.  
  5. <fx:Script>
  6. <![CDATA[
  7.  
  8. [Embed(source="assets/images/rightArrowBlue.png")]
  9. [Bindable]
  10. public var arrowImage:Class;
  11. ]]>
  12. </fx:Script>
  13.  
  14. <s:SkinnableContainer skinClass="skins.ItemRendererSkin" width="100%" height="100%">
  15. <s:Label text="{data.title}" left="20" top="20" verticalAlign="middle"/>
  16. <s:Group right="0" top="0">
  17. <s:Image source="{arrowImage}"/>
  18. </s:Group>
  19. </s:SkinnableContainer>
  20.  
  21.  
  22. </s:ItemRenderer>
  23.  
  24. /////////////////////
  25.  
  26. <?xml version="1.0" encoding="utf-8"?>
  27. <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
  28. xmlns:s="library://ns.adobe.com/flex/spark">
  29. <!-- host component -->
  30. <fx:Metadata>
  31. [HostComponent("spark.components.SkinnableContainer")]
  32. </fx:Metadata>
  33.  
  34. <!-- states -->
  35. <s:states>
  36. <s:State name="disabled" />
  37. <s:State name="normal" />
  38. </s:states>
  39.  
  40. <s:Rect top="0" bottom="0" right="0" left="0">
  41. <s:fill>
  42. <s:LinearGradient rotation="90">
  43. <s:GradientEntry color="0xffffff"/>
  44. <s:GradientEntry color="0xeeeeee"/>
  45. </s:LinearGradient>
  46. </s:fill>
  47. </s:Rect>
  48.  
  49. <s:Group id="contentGroup"/>
  50.  
  51. <!-- SkinParts
  52. name=contentGroup, type=spark.components.Group, required=false
  53. -->
  54. </s:Skin>

Report this snippet  

You need to login to post a comment.