flash - how to italicize part of a string for a flex list/dataprovider? -
how make half string become italic after new line(\n)? doesnt work :(
<?xml version="1.0" encoding="utf-8"?> <s:application creationcomplete="populate()" minheight="600" minwidth="955" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"> <fx:script> <![cdata[ import mx.collections.arraycollection; [bindable] public var listofpeople:arraycollection; public function populate():void { var testdata:string = "test\<i>ntest</i>,test\ntest\ntest"; listofpeople = new arraycollection(testdata.split(",")); } ]]> </fx:script> <s:list dataprovider="{listofpeople}" horizontalcenter="0" verticalcenter="0" />
fixed it. if wants know how did datagrid:
<s:gridcolumn datafield="rooms"> <s:itemrenderer> <fx:component> <s:griditemrenderer> <s:vgroup> <s:label text="{data.rooms}" height="100%" right="10" verticalalign="middle" fontweight="bold" fontstyle="italic"/> <s:label text="{data.rooms}" height="100%" right="10" verticalalign="middle" fontweight="bold" fontstyle="italic"/> </s:vgroup> </s:griditemrenderer> </fx:component> </s:itemrenderer> </s:gridcolumn>
similiar can done list etc
http://www.adobe.com/devnet/flex/videotraining/exercises/ex4_05.html
Comments
Post a Comment