1

我已经创建了一个带有自定义项目渲染器的图块列表,并且在功能方面它可以正常工作。我将项目渲染器的宽度和高度降低到 95%,然后在该项目的剩余 5% 中显示平铺列表背景。问题是,只有当我将鼠标悬停在项目上时,背景才会被遮盖,我无法在项目之间出现间隙。是否可以更改悬停的高度和宽度?我错过了一些简单的东西吗?

<mx:Canvas id="Card2" label="Card2" width="100%" height="100%" backgroundColor="#FFFFFF">
    <mx:TileList id="tlCard2" x="10" y="10" dataProvider="{acCard2}" width="580" height="340" dropEnabled="true" borderThickness="0" maxColumns="4" maxRows="4" rowHeight="85" columnWidth="145" borderColor="#000000" horizontalScrollPolicy="off" verticalScrollPolicy="off" borderStyle="solid" dragMoveEnabled="true" dragEnabled="true" backgroundImage="{imgGuide}" themeColor="#BCBCBC">
        <mx:itemRenderer>
            <mx:Component>                          
                <mx:Image source="{assets/' + data.imageId + '.jpg'+ '?cachekill=\'' + new Date()}" horizontalAlign="center" verticalAlign="middle" width="95%" height="95%" scaleContent="false" maintainAspectRatio="true"/>                              
            </mx:Component>
        </mx:itemRenderer>
    </mx:TileList>
</mx:Canvas>

提前致谢!:)

4

3 回答 3

2

对于火花组件,您有 autoDrawBackground="false"

试试http://blog.flexexamples.com/2010/04/22/removing-the-rollover-and-selection-highlight-on-a-spark-list-control-in-flex-4/

对于 mx 尝试 useRollOver = false

试试http://blog.flexexamples.com/2008/02/01/disabling-item-roll-over-highlighting-in-the-flex-datagrid-control/

于 2011-06-20T15:27:37.480 回答
2

TileList 继承 paddingTop paddingBottom 属性设置那些应该这样做。

您可以尝试的另一件事是将 TileList 的 rowHeight 和 itemRenderer 的高度设置为小于 rowHeight 的值

于 2011-06-21T19:25:11.510 回答
1

我认为你应该使用padding styles family

于 2011-06-20T15:25:39.277 回答