问题状况:
对于使用ItemRenderer组件的控件,在滚动条滚动时ItemRenderer渲染的对象会不按原先的渲染位置排列,就是数据行错位了。
解决方法:
先实现两个接口 IListItemRenderer, IDataRenderer,有的as类可能继承于Container类的对象就不需要,然后加入如下代码。
[Bindable("dataChange")]
override public function get data():Object{
return this._data;
}
override public function set data(value:Object):void{
this._data = value;
this.invalidateProperties();
this.dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}