Touch events will fire on the outer most UI element first.
Add return true
to the end of "?" button touch event to signal that the touch has been handled by the code.
Without the return true
, the touch event does not know it is handled and subsequently fires on all elements that contain the touch (giving priority to elements outermost elements)
function QuestionMarkTouchEvent( event )
if event.phase == "began" then
-- Do some stuff
end
return true -- this tells the program not to fire the touch event again on elements under this.
end
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…