Note that there are some explanatory texts on larger screens.

plurals
  1. POspark list item renderer
    primarykey
    data
    text
    <p>How do I wordwrap in a spark list w/ an itemrenderer? This posting at <a href="http://blog.flexexamples.com/2009/10/27/setting-word-wrapping-on-a-spark-list-control-in-flex-4/" rel="nofollow">http://blog.flexexamples.com/2009/10/27/setting-word-wrapping-on-a-spark-list-control-in-flex-4/</a> works 100% but when I try to set a separate item renderer, I can't get the word wrapping...instead, I get an ugly horizontal scroll bar. HEre is my mxml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" xmlns:mx="library://ns.adobe.com/flex/mx"&gt; &lt;s:List id="lst" useVirtualLayout="false" width="200" horizontalCenter="0" verticalCenter="0" itemRenderer="testRenderer" &gt; &lt;s:dataProvider&gt; &lt;s:ArrayList&gt; &lt;fx:Object /&gt; &lt;/s:ArrayList&gt; &lt;/s:dataProvider&gt; &lt;/s:List&gt; &lt;/s:Application&gt; </code></pre> <p>here is my testRenderer ------------></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:ItemRenderer name="testRenderer" 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" creationComplete="makeLabel(event);"&gt; &lt;s:states&gt; &lt;s:State name="normal" /&gt; &lt;s:State name="hovered" /&gt; &lt;s:State name="selected" /&gt; &lt;/s:states&gt; &lt;s:layout&gt; &lt;s:VerticalLayout gap="0" horizontalAlign="justify" /&gt; &lt;/s:layout&gt; &lt;fx:Script&gt; &lt;![CDATA[ protected function makeLabel(evt:Event):void { test.text = "this is just a really long line of text that I want to wrap and just look normal"; } ]]&gt; &lt;/fx:Script&gt; &lt;s:HGroup&gt; &lt;s:Label id="test" color="black" /&gt; &lt;/s:HGroup&gt; &lt;/s:ItemRenderer&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload