private _list:eui.List;
// 可以为list里所有的item添加点击事件
this._list.addEventListener(eui.ItemTapEvent.ITEM_TAP, this.onTap, this);
onTap() {
for (var i = 0; i < this._list.numChildren; i++) {
// 判断list中的子项,是否是当前点击的子项
// 用itemIndex 和 selectedIndex判断,相等就是当前选中的子项
let tempEle = this._list.getChildAt(i) as ItemChoose;
if (tempEle.itemIndex == this._list.selectedIndex) {
tempEle["choose"](true);
}
else {
tempEle["choose"](false);
}
}
}
class ItemChoose extends eui.ItemRenderer {
public choose;
// 选中效果
chooseBox(bool) {
this.choose = bool;
}
}