[]List中如何动态加载多个image,并为每个image添加监听事件?
var Index=(function(_super){
function Index(){
Index.super(this);
this.data = ["1tong","2tong","3tong","4tong","5tong","6tong","7tong","8tong","9tong","1tiao","2tiao","3tiao","4tiao","5tiao"];
var _dataSource_=[];
for(var i = 0;i<this.data.length;++i)
{
var _data_={
skin:"Images/"+this.data[i]+".jpg"
};
_dataSource_.push(_data_);
}
this.selfHand.dataSource = _dataSource_;
this.selfHand.selectEnable = true;
}
Laya.class(Index,"Index",_super);
return Index;
})(IndexUI);
function Index(){
Index.super(this);
this.data = ["1tong","2tong","3tong","4tong","5tong","6tong","7tong","8tong","9tong","1tiao","2tiao","3tiao","4tiao","5tiao"];
var _dataSource_=[];
for(var i = 0;i<this.data.length;++i)
{
var _data_={
skin:"Images/"+this.data[i]+".jpg"
};
_dataSource_.push(_data_);
}
this.selfHand.dataSource = _dataSource_;
this.selfHand.selectEnable = true;
}
Laya.class(Index,"Index",_super);
return Index;
})(IndexUI);
要回复问题请先登录
1 个回复
cuixueying
赞同来自:
动态添加Image,,,你用list.setItem()