这对我来说似乎很好。这是我的代码:
<?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/halo" minWidth="1024" minHeight="768" xmlns:components="components.*">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var items:ArrayCollection = new ArrayCollection([{name:"foo",value:"bar"},
{name:"foo",value:"bar"},
{name:"foo",value:"bar"},
{name:"foo",value:"bar"},
{name:"foo",value:"bar"},
{name:"foo",value:"bar"},
{name:"foo",value:"bar"},
{name:"foo",value:"bar"}]);
]]>
</fx:Script>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/halo";
@namespace components "components.*";
#queueView
{
alternating-item-colors: red, yellow;
}
</fx:Style>
<mx:List id="queueView" dataProvider="{items}" width="200">
<mx:itemRenderer>
<fx:Component>
<mx:VBox>
<mx:Label text="{data.name}"/>
<mx:Label text="{data.value}"/>
</mx:VBox>
</fx:Component>
</mx:itemRenderer>
</mx:List>
</s:Application>
结果如下:
你正在运行什么版本?我正在运行最近几周发布的最新测试版。确切地说,构建 4.0.0.253292。如果您还没有升级到最新版本,您可以尝试升级,也可以尝试清理您的项目。还要确保您的浏览器没有缓存 swf,这有时会在文件大小没有显着变化时发生。
如果我错过了什么,请告诉我。但是您的代码似乎工作正常。