PageView* pageView = PageView::create();
pageView->setTouchEnabled(true);
pageView->setSize(Size(winSize.width,winSize.height));
//pageView->setAnchorPoint(Point(0,0));
//pageView->setPosition(Point(winSize.width/2,winSize.height/2));
for (int i = 0; i < 7; i++) {
int position = i + 1;
int tag = i + 100;
char res[15]={0};
sprintf(res, "continent%d.png",position);
auto layout = Layout::create();
layout->setSize(winSize);
//layout->setPosition((Point(winSize.width/2,winSize.height/2)));
Sprite* imageView = Sprite::createWithSpriteFrameName(res);
imageView->setPosition(Point(winSize.width/2,winSize.height/2));
imageView->setScale(3);
imageView->setTag(tag);
_touchListener = EventListenerTouchOneByOne::create();
_touchListener->setSwallowTouches(true);
_touchListener->onTouchBegan = CC_CALLBACK_2(SelectContinent::onTouchBegan, this);
EventDispatcher* dispatcher = Director::getInstance()->getEventDispatcher();
dispatcher->addEventListenerWithSceneGraphPriority( _touchListener, imageView);
continent_img.pushBack(imageView);
layout->addChild(imageView);
pageView->addPage(layout);
}
현재 pageview 구현코드가 저렇게 되어있는데요. imageView를 클릭해도 이벤트가 발생 안하는데 뭐가 문제인건가요??