[LayaAir3]GList点击出现连续点击问题
GList 点击一下执行多次 使用
numItems=0
refreshVirtualList()
更新的列表
numItems=0
refreshVirtualList()
更新的列表
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
谷主
赞同来自:
Archangelᴱᴿᴵᑦ
赞同来自:
this.Gbox_list.setVirtual();
其次对于virtual list, 相当于在复用cell, 逻辑上100行的,实际上是在反反复复就重复用那几个.
因此你 on(xxx....) 这种语法,如果滚动后发生cell复用,相当于在重复注册事件.
在refresh data后,你也相当于在重复注册事件,所以你 reload all data 几次,你就会重复几次.
首先你的这写法不正规,不和文档;
再者,如果就按你这个路数,你在 on 注册事件之前,先 off 掉吧,例如
item.getChildByName('name').offAllCaller(this);
item.getChildByName('name').on(Laya.Event.CLICK, this, ()=>{
...
}