List 具有大开销数据集的Flex mobile列表
我遇到了一个问题,加载一个包含100个条目的列表需要相当长的时间。我使用预生成的arraycollection传递给数据提供程序,自定义项呈现程序由嵌套容器组成。当我调用这个List 具有大开销数据集的Flex mobile列表,list,apache-flex,mobile,itemrenderer,arraycollection,List,Apache Flex,Mobile,Itemrenderer,Arraycollection,我遇到了一个问题,加载一个包含100个条目的列表需要相当长的时间。我使用预生成的arraycollection传递给数据提供程序,自定义项呈现程序由嵌套容器组成。当我调用这个list.dataProvider=arraycollection,它会冻结大约4秒钟,然后只显示列表 是否有解决此问题的方法 以下是我的代码: [编辑] private function populateList():void { array = new Array();
list.dataProvider=arraycollection代码>,它会冻结大约4秒钟,然后只显示列表
是否有解决此问题的方法
以下是我的代码:
[编辑]
private function populateList():void
{
array = new Array();
for (var i:int =0;i<100;i++)
{
array.push({
dateLabel:"LIVE",
timeLabel:"06:05",
homeTeamLabel:"Liverpool",
homeScoreLabel:"1",
awayScoreLabel:"0",
awayTeamLabel:"Chelsea",
homeTeamHandicapLabel:"Liverpool",
homeHandicapLabel:"2/5",
awayTeamHandicapLabel:"Chelsea",
awayHandicapLabel:"",
priceHomeHandicapLabel:"1.950",
priceAwayHandicapLabel:"1.950"
});
}
trace("done loading");
testarr = new ArrayCollection(array);
liveList.dataProvider = testarr;
}
私有函数populateList():void
{
数组=新数组();
对于(var i:int=0;i当我用滚动条和VGroup包装列表时,性能会受到影响。当我删除它们时,列表加载得很好。您应该显示更多代码。还要指定您的目标设备。这是设备上的问题吗?在模拟器中?是调试版本还是发布版本?您好,感谢t他说,“我的代码已经添加了。这是Android设备的发布版本。itemrenderer中有什么?粘贴代码。你的列表看起来不错。”。
<s:Scroller width="100%" height="100%" horizontalScrollPolicy="off">
<s:VGroup id="lists" gap="0" left="0" right="0" top="0" bottom="0">
<s:List id="liveList" width="100%" itemRenderer="customItemRenderer" creationComplete="populateList()"
contentBackgroundColor="0xf0f0f0" useVirtualLayout="true" depth="0" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<s:layout>
<s:VerticalLayout gap="0" variableRowHeight="true" requestedMinRowCount="1" useVirtualLayout="true"/>
</s:layout>
</s:List>
</s:VGroup>
</s:Scroller>