How to pick ui::button inside the ListView

i have create Listview like this

#pragma mark Scroll Robot
listView = ui::ListView::create();
listView->setDirection(cocos2d::ui::ScrollView::Direction::VERTICAL);
listView->setScale(SCALE_RATIO_XY);
listView->setBounceEnabled(true);
listView->setTouchEnabled(true);
listView->setPosition(Vec2(POSX333,POSY303));
listView->setScrollBarOpacity(0);
layer2->addChild(listView,10);
listView->setContentSize(Size(320,230));
listView->setScrollBarEnabled(true);
listView->setAnchorPoint(Vec2(1,1));
listView->addEventListener(CC_CALLBACK_2(PlayArea_Quest::selectedItemEvent, this));

and add button like

for(int i=1;i<=TotalLevelIcon;i++)
{

    button[i] = cocos2d::ui::Button::create("PA_Q_Text.png", "PA_Q_Text.png");
    button[i]->setScaleX(SCALE_RATIO_X);
    button[i]->setScaleY(SCALE_RATIO_Y*Scale_XY);
    button[i]->setFlippedX(true);
    button[i]->setTag(i);
    listView->addChild(button[i]);
}

so now how to pick button and move in screen location

  1. You can add a touch event listener to the ui-button.
  2. You can use a CCMenuItem instead and use menuCallbacks.
  3. If the touch area of button is same as the content size of listview item, you can use listView methods.

Sorry but I don’t know how to implement so can you please give an example

Look in Cpp-tests. It is your friend when looking for how to implement engine features. You need an event on the button.

did you figure it out?