cocos2d-x 3.0 Final 另一Bug: CCControl touch优先级改变(有代码有真相)

废话不说,直接比较2.x和3.0 final的代码,都是哪个eventlistener的问题:

2.x里面:

bool CCControl::init()
{
if (CCLayer::init())
{
//this->setTouchEnabled(true);
//m_bIsTouchEnabled=true;
// Initialise instance variables
m_eState=CCControlStateNormal;
setEnabled(true);
setSelected(false);
setHighlighted(false);

// Set the touch dispatcher priority by default to 1
this->setTouchPriority(1); //这里设定了CCControl(例如CCControlButton什么的)的touch优先级比正常的低一点
// Initialise the tables
m_pDispatchTable = new CCDictionary();
// Initialise the mapHandleOfControlEvents
m_mapHandleOfControlEvent.clear();

    return true;
}
else
{

return false;
}
}

再来看3.0里面
bool Control::init()
{
if (Layer::init())
{
// Initialise instance variables
_state=Control::State::NORMAL;
setEnabled(true);
setSelected(false);
setHighlighted(false);

auto dispatcher = Director::getInstance()->getEventDispatcher();
auto touchListener = EventListenerTouchOneByOne::create();
touchListener->setSwallowTouches(true);
touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this);
touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this);
touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this);
touchListener->onTouchCancelled = CC_CALLBACK_2(Control::onTouchCancelled, this);

    dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this); // 这里touchListener的优先级和缺省的一样,应该都是0

    return true;
}
else
{

return false;
}

}

造成后果:
假设你在TableView的 Cell中加入CCControlButton或者什么东西,在2.x里面,因为CCControl的优先级较低,TableView可以正常处理touch事件进行拖动;但是在3.0里面,因为CCControl优先级同等且是子结点,touch事件被截获,到达不了TableView,于是你的啥可拖动列表统统完蛋。。。

我不知道这是by design还是咋的,但是很不方便,而且没有什么方便的方式去改变子Node的优先级??

3.0的TableView由于被启用,所以会用很多问题,不建议使用

被弃用。。。。

— Begin quote from ____

引用第1楼佐耳云儿于2014-04-29 18:11发表的 :
3.0的TableView由于被启用,所以会用很多问题,不建议使用 http://www.cocoachina.com/bbs/job.php?action=topost&tid=199947&pid=940661

— End quote

那请问用什么代替?类似tableview的推荐用什么?

我之前也碰到过差不多的问题…一个edbox绑到widget上 只要跟别的widget重合 无论你绑定的widget的层级是在另外一个widget的上或者下…永远收不到点击事件…后来我都直接手动激活edbox的openKeyboard事件了…

请问用什么替代 TableView ?
这个挺好用的呀