Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex Mobile: List flickers
    text
    copied!<p>Ok I have a List with an IconItemRenderer in it. When I set it's dataprovider in AS3 and I begin scrolling, the list is flickering one time (gets white for one frame). This only happens when the messageField/messageFunction is set and there is a different number of lines in the message areas. I'm sure this is a framework bug. Has anyone had the same experience? I would be glad if someone knows a workaround for this. Thanks in advance.</p> <hr> <p>Here's an example code for a view component. Strange to say the flickering seems to take sometimes more, sometimes less time. I tested it on Android and in Desktop mode (adl), error occures on both. The "blabla.." is just to get a string with a random number of lines.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView"&gt; &lt;s:actionContent&gt; &lt;s:Button label="Set List" click="btn_click(event)"/&gt; &lt;/s:actionContent&gt; &lt;s:List width="100%" height="100%" id="list"&gt; &lt;s:itemRenderer&gt; &lt;fx:Component&gt; &lt;s:IconItemRenderer messageField="text"/&gt; &lt;/fx:Component&gt; &lt;/s:itemRenderer&gt; &lt;/s:List&gt; &lt;fx:Script&gt; &lt;![CDATA[ import mx.collections.ArrayList; protected function btn_click(event:MouseEvent):void { var al:ArrayList = new ArrayList; var obj:Object; var str:String = "blablablablablablablablablablablablablablablablablablablablabblablablablablablablablablablablablablablablablablablablablabblablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablablabla"; for(var i:int = 0; i &lt; 20; i++) { obj = new Object; obj.text = str.substr(0, Math.random()*str.length); al.addItem(obj); } list.dataProvider = al; } ]]&gt; &lt;/fx:Script&gt; &lt;/s:View&gt; </code></pre> <hr> <p>See bug report: <a href="https://issues.apache.org/jira/browse/FLEX-33383" rel="nofollow">https://issues.apache.org/jira/browse/FLEX-33383</a></p> <p>For the workaround see the correct answer below.</p>
 

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