Apache flex Flex自定义列表选择未高亮显示
我想在Flex中为接口原型创建一个自定义列表。该列表应该有一个图像和3个文本字段。这就是我到目前为止所做的,显示的控件就是我想要的。但是,当我单击其中一个项目时,该项目在视觉上似乎没有被选中。我不确定我将如何实现这一点 以下是我目前的代码:Apache flex Flex自定义列表选择未高亮显示,apache-flex,flash,list,custom-controls,selection,Apache Flex,Flash,List,Custom Controls,Selection,我想在Flex中为接口原型创建一个自定义列表。该列表应该有一个图像和3个文本字段。这就是我到目前为止所做的,显示的控件就是我想要的。但是,当我单击其中一个项目时,该项目在视觉上似乎没有被选中。我不确定我将如何实现这一点 以下是我目前的代码: <s:List width="400" height="220" dataProvider="{arrColl}" alternatingItemColors="[#EEEEEE, white]"> &l
<s:List width="400" height="220"
dataProvider="{arrColl}"
alternatingItemColors="[#EEEEEE, white]">
<s:itemRenderer>
<fx:Component>
<mx:Canvas height="100">
<mx:Image height="90" width="120" source="{data.imageSource}"></mx:Image>
<mx:Label left="125" y="10" text="{data.title}" />
<mx:Label left="125" y="30" text="{data.type}" />
<mx:Label left="125" y="50" text="{data.description}" />
</mx:Canvas>
</fx:Component>
</s:itemRenderer>
</s:List>
不确定data.imageSource是哪种图形。也许图像掩盖了高光。你能试着把它做成画布的背景图片吗?另外,我注意到在列表和网格中使用PNG或JPG图像可以遮罩高光颜色。它们还可以防止鼠标点击到达列表项。如果可能的话,尝试使用带有矢量图形的SWF。对于其他被困在同一条船上的人-这就是我所做的,它现在可以工作了:
<mx:List width="400" height="220"
dataProvider="{arrColl}"
alternatingItemColors="[#EEEEEE, white]">
<mx:itemRenderer>
<fx:Component>
<mx:Canvas height="100">
<mx:Image height="90" width="120" source="{data.imageSource}"></mx:Image>
<mx:Label left="125" y="10" text="{data.title}" fontWeight="bold" />
<mx:Label left="125" y="30" text="{data.type}" fontStyle="italic" />
<mx:Label left="125" y="50" text="{data.description}" />
</mx:Canvas>
</fx:Component>
</mx:itemRenderer>
</mx:List>
注意:区别在于列表和itemRenderer来自mx命名空间而不是s命名空间。您使用的是哪个版本的Flex SDK?@lach:I使用的是Flex 4