[LayaAirIDE 2.0]list组件改变位置后在改变数据源的长度,会导致index超过数据源长度

list组件的数据源的长度有3项,然后改变list组件的位置,在改变list的数据源长度,长度变小(此处变1项),会导致list的renderhandler还是以长度3来计算,导致index越界.
1568875295(1).jpg 1568875421(1).jpg
已邀请:

Laya新用户

赞同来自:

demo上传不上

Aar0n

赞同来自:

private onClick(e: Laya.Event) {
 
 
this._data = [1];
 
this.list.array = this._data;
this.list.y = 220;
this.list.height = 300;
 
}
 
代码这么写就好了

Laya新用户

赞同来自:

这2行换位置也可以解决问题

要回复问题请先

商务合作
商务合作