【问题标题】:Flex container with items of variable size具有可变大小项目的弹性容器
【发布时间】:2009-02-07 00:31:55
【问题描述】:

我需要使用 Flex 显示图像的水平列表。我不能使用水平的 TileList,因为这些瓷砖最终都是第一项的大小。是否有一个 flex 控件可以让我拥有不同大小的项目?

编辑:项目列表最好来自数据提供者。不幸的是,如果项目具有固定宽度,则 Chetan Sastry 的答案中的控件仅支持数据提供者。

【问题讨论】:

    标签: apache-flex flex3


    【解决方案1】:

    这是我认为您正在描述的代码段。图像有不同的尺寸,但这会将它们显示在一个正方形的网格中。诀窍(至少对于我的要求)是为进入每个单元格的容器设置高度和 minWidth。

    <mx:TileList id="imgTiles" width="100%" height="100%"  
          paddingTop="2" paddingBottom="2" paddingLeft="2" paddingRight="2"  
          itemClick="eTilesClick(event)">     
        <mx:itemRenderer>  
            <mx:Component>  
                <mx:VBox horizontalAlign="center"  
                       height="250" minWidth="150"  
                       horizontalScrollPolicy="off" verticalScrollPolicy="off"  
                       borderColor="#D2D2D2" borderThickness="1"
                       borderStyle="solid">
                    <mx:Label text="{data.imageCaption}" height="15" fontSize="10" fontWeight="bold"/>
                    <mx:Image source="{data.thumbnailUrl}" width="100%"/>
                </mx:VBox>
            </mx:Component>
        </mx:itemRenderer>
    </mx:TileList>
    

    【讨论】:

      【解决方案2】:

      HBoxRepeater 用于您的图片怎么样?

      【讨论】:

        猜你喜欢
        • 2020-07-07
        • 2017-02-20
        • 2020-01-23
        • 1970-01-01
        • 2017-03-05
        • 2021-02-24
        • 1970-01-01
        • 2021-11-01
        • 1970-01-01
        相关资源
        最近更新 更多