来回在cc.Layer移除添加cocostudio界面会导致在当前layer的界面按钮失效

UIManager.uiLayer = cc.Layer:create()
local function replaceWidget(aWidgetName)
local ui_widget = WidgetManager.create(aWidgetName)—此处就是加载的studio界面
if ui_widget then
local prev_uiWidget = UIManager.uiLayer:getChildByTag(ui_widget:getTag())—此处tag是一样的
if prev_uiWidget then
UIManager.uiLayer:removeChild(prev_uiWidget, false)
end
UIManager.uiLayer:addChild(ui_widget)
end
end

uilayer上有另外一个stuido界面 界面里有两个按钮
local function onBtnEvent(sender, eventType)
if eventType == ccui.TouchEventType.ended then
if sender == btn_home then
replaceWidget(“ui_home_page”)
elseif sender == btn_troops then
replaceWidget(“ui_menu”)
end
end
end
btn_home:addTouchEventListener(onBtnEvent)
btn_troops:addTouchEventListener(onBtnEvent)

快速切换两个按钮会导致这两个按钮卡死 最后调试发现是UIWidget内的_touchEventCallback为空 当点击其他界面的按钮时 下方的按钮就又好使了
不知道是不是coocos2dx的bug ,还望各位大神试试 我这个是cocos2dx3.2 其他版本不知道有没有这个问题