我有一个简单的列表和一个后台刷新协议。
当列表向下滚动时,刷新会将其滚动回顶部。我想阻止这一切。
我尝试捕捉 COLLECTION_CHANGE 事件并
validateNow(); // try to get the component to reset to the new data
list.ensureIndexIsVisible(previousIndex); // actually, I search for the previous data id in the IList, but that's not important
这会失败,因为列表在更改后会自行重置(在 DataGroup.commitProperties 中)。
我讨厌使用 Timer、ENTER_FRAME 或 callLater(),但我似乎想不出办法。
我能看到的唯一其他选择是对 List 进行子类化,以便它可以捕获皮肤中的 DataGroup 正在抛出的 dataProviderChanged 事件。
有任何想法吗?