0

假设我有 rowIndex 和 columnIndex,我想更改此单元格的背景颜色

4

1 回答 1

2

一种方法是扩展默认 itemRenderer 并覆盖 set data 方法:

 override public function set data(value:Object):void {
            super.data = value;
            // retrieve the value of the list-based control's new public property
            var minAge:Number = (listData.owner as MyList).minAge;
            if (data.age < minAge) {
                listLabel.setStyle("color",0xFF0000);
            } else {
                listLabel.setStyle("color",0x000000);
            }
        }

这是一个很好的例子的链接:

http://blog.flexdevelopers.com/2009/06/flex-examples-item-renderers-in.html

于 2013-09-24T09:21:12.010 回答