我正在使用自定义 itemrenderer 来显示照片列表,并且需要知道如何控制宽度。目前它这样做:
(来源:tdwright.co.uk)
我相信你会同意,这丑得令人流血。
该列表是这样创建的:
<mx:Panel width="100%" height="100%" layout="absolute" title="Photos">
<mx:List x="0" y="0" width="100%" height="100%" id="photoList" dataProvider="{photos}" itemRenderer="thumbnails" rowHeight="100"/>
</mx:Panel>
itemrenderer 组件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Image source="{data.src}" id="image" scaleContent="true" toolTip="{data.caption}" height="100%" horizontalAlign="center"/>
</mx:VBox>
我试过将 width="100%" 放在一大堆地方,但没有成功。如果有人知道我如何控制这一点,我将不胜感激。