// 添加事件监听器
listView->addEventListener(=](Ref pSender, ListView::EventType type){
switch (type)
{
case ListView::EventType::ON_SELECTED_ITEM_START:
{
ListView listView = static_cast<ListView*>(pSender);
log(“select child start index = %ld”, listView->getCurSelectedIndex());
break;
}
case ListView::EventType::ON_SELECTED_ITEM_END:
{
ListView* listView = static_cast<ListView*>(pSender);
log(“select child end index = %ld”, listView->getCurSelectedIndex());
break;
}
default:
break;
}
});
//上面addEventListener前面的箭头那里老是报错,说“有多个重载函数列表与参数列表匹配”。
//我知道ListView是继承自ScrollView,而且ScrollView也有这么个虚函数,但是为什么ide会分不出我调用哪一个?这很明显啊