以Button为例,代码如下:
local function
createCocostudioUI()
local ccsLayout
= ccs.GUIReader:shareReader():widgetFromJsonFile(
"DemoLogin/DemoLogin.json")
--local ccsButton = ccsLayout:getChildByName("login_Button")
local ccsButton
= ccsLayout:
getChildByTag(
14)
ccsButton:addTouchEventListener(
function(
...)
ccsLayout:setVisible(
false)
end)
return ccsLayout
end