We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
laya虚拟列表赋值数据执行2次itemRenderer函数
遇到和论坛的同样问题,研究发现Laya2.0引擎内部升级导致的
Laya 2.0以上对Timer中的callLater的逻辑进行了解耦合,而在Laya 1.7中,是将callater的时钟处理放在Timer中,所以Timer.clear无法清理这个Laya.timer.callLater定时器
源代码【Glist中有两处的Laya.timer.clear是清理_refreshVirtualList不了的】 if (this._virtualListChanged != 0) Laya.timer.clear(this, this._refreshVirtualList); this._refreshVirtualList();
if (this._virtualListChanged != 0) Laya.timer.clear(this, this._refreshVirtualList); this._refreshVirtualList();
调整为: if (this._virtualListChanged != 0) Laya.CallLater.I._laters.forEach((element, index) => { if (element.method.name == "_refreshVirtualList") { Laya.CallLater.I._laters.splice(index, 1); } }); this._refreshVirtualList();
if (this._virtualListChanged != 0) Laya.CallLater.I._laters.forEach((element, index) => { if (element.method.name == "_refreshVirtualList") { Laya.CallLater.I._laters.splice(index, 1); } }); this._refreshVirtualList();
已向引擎组提相关的issue
The text was updated successfully, but these errors were encountered:
那其实不用callLater,改成用timer一个很短的时间?
Sorry, something went wrong.
No branches or pull requests
laya虚拟列表赋值数据执行2次itemRenderer函数
遇到和论坛的同样问题,研究发现Laya2.0引擎内部升级导致的
Laya 2.0以上对Timer中的callLater的逻辑进行了解耦合,而在Laya 1.7中,是将callater的时钟处理放在Timer中,所以Timer.clear无法清理这个Laya.timer.callLater定时器
源代码【Glist中有两处的Laya.timer.clear是清理_refreshVirtualList不了的】
if (this._virtualListChanged != 0) Laya.timer.clear(this, this._refreshVirtualList); this._refreshVirtualList();
调整为:
if (this._virtualListChanged != 0) Laya.CallLater.I._laters.forEach((element, index) => { if (element.method.name == "_refreshVirtualList") { Laya.CallLater.I._laters.splice(index, 1); } }); this._refreshVirtualList();
已向引擎组提相关的issue
The text was updated successfully, but these errors were encountered: