Here is the situation. I got a scrollView which is around 90% of height of the screen. A user is able to grab it by touch and move all its content down almost to the bottom of the screen. When the touch is released, the content goes back… but I do not want a user to move it that deep down the screen. At certain moment the movement sequence has to be aborted as if a user removed the finger from the screen. The following function can define the exact moment when the touch has to be aborted. But I do not know how.
local function scrollListener(event)
if ( event.phase == "moved" ) then
an_sv = event.target
local dy = ( event.y - event.yStart )
print (dy)
local x, y = an_sv:getContentPosition()
if y > 10 then
print("gotta scroll back!")
-- a line to abort the touch :scrollToPosition does not work here...
end
end
end