There is a difference between Rects and Widget display objects on scrollViews regarding touch phases.
Posting in case this is not as intended and for discussion.
Code to reproduce:
rlistener=function(e)print(e.phase) --return true end function scene:create(e) sv=widget.newScrollView ( { top = 0, left = 0, width = 320, height = 568, scrollWidth = 320, horizontalScrollDisabled=true, } ) r=display.newRect(50,50,50,50) r:setFillColor(0) r:addEventListener("touch",rlistener) sv:insert(r) self.view:insert(sv) end
Expected result:
Listener logging the same touch phases as for other displayObjects.
Actual result:
Listener logs only the phase “began”.
To restore normal behavior,
a ) comment the line “sv:insert( r )”, or
b ) uncomment the line “return true”.
If you swap out the rect for a Widget object such as a Button or Label, b ) is not required. This is the difference in behavior.
This is not about how to use touch listeners, just a difference that I noted that I haven’t seen reflected in the documentation.