Skip to content

Instantly share code, notes, and snippets.

@javierjulio
Created October 7, 2010 21:34
Show Gist options
  • Save javierjulio/615933 to your computer and use it in GitHub Desktop.
Save javierjulio/615933 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600">
<s:layout>
<s:HorizontalLayout gap="20" paddingTop="15" paddingLeft="15" />
</s:layout>
<fx:Declarations>
<s:ArrayList id="data">
<fx:Object label="This is the color of blueberries and blue cheese."/>
<fx:Object label="This is the color of beans, cucumbers, peas, spinach, lettuce, cabbage and limes."/>
<fx:Object label="This is the color of lemons and squash."/>
<fx:Object label="This is the color of carrots."/>
<fx:Object label="This is the color of tomatoes, cherries, some apples, some potatoes and beets."/>
</s:ArrayList>
</fx:Declarations>
<s:List dataProvider="{data}" width="250">
<s:layout>
<!-- by default "contentJustify" is used, use "justify" for text to wrap -->
<s:VerticalLayout gap="0" horizontalAlign="justify" />
</s:layout>
</s:List>
<!-- List with custom item renderer -->
<s:List dataProvider="{data}" width="250">
<s:layout>
<s:VerticalLayout gap="0" horizontalAlign="justify" />
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:layout>
<!-- by default "contentJustify" is used, use "justify" for text to wrap -->
<s:HorizontalLayout paddingLeft="5" paddingRight="5"
paddingTop="7" paddingBottom="7"
verticalAlign="justify" />
</s:layout>
<s:Label text="{itemIndex + 1}." fontWeight="bold" />
<!-- with horizontal or veritcal layout, width must be set for text to wrap! -->
<s:Label id="labelDisplay" width="100%" />
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:Application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment