用cocos studio做的listview,listview的item也是单独用cocos studio做的,如果item上有button的话,运行时,button只能响应点击事件,如果按着button,不能滑动listview。
解决办法,可以设置在button按下的时候button的setTouchSwallowEnabled() 为false,点击的时候为true。
function hallTask:setBtnGo(content)
local btn_go = cc.uiloader:seekNodeByPath(content, "Panel_11/btn_go")
btn_go:onButtonClicked(function()
btn_go:setTouchSwallowEnabled(true)
end)
btn_go:onButtonPressed(function()
btn_go:setTouchSwallowEnabled(false)
end)
end