Scrollview Scrolling

When I create a scrollview and add items to it you have to place your finger in between the items to be able to slide the view up and down.  This is has recieved some complaints because if you place your finger on the screen and scroll up it sometimes appears to “not work”.  Is there something I can do to have the scrollview events register?  I’ve tried bringing the scrollview to the front … and making sure my items return false to keep propagating the events.

if they dont already, give your items a touch listener, and use the ‘moved’ phase to test for ‘some amount of movement’, then have the scrollview take focus.

e.g.

something like:

local phase = event.phase if ( phase == "moved" ) then local dy = math.abs( ( event.y - event.yStart ) ) -- If the touch on the button has moved more than 10 pixels, -- pass focus back to the scroll view so it can continue scrolling if ( dy \> 10 ) then scrollView:takeFocus( event ) end end return true

Thanks!  I’ll give that a try – I think it’ll do the trick.

Thanks JWiow, that did the trick.

if they dont already, give your items a touch listener, and use the ‘moved’ phase to test for ‘some amount of movement’, then have the scrollview take focus.

e.g.

something like:

local phase = event.phase if ( phase == "moved" ) then local dy = math.abs( ( event.y - event.yStart ) ) -- If the touch on the button has moved more than 10 pixels, -- pass focus back to the scroll view so it can continue scrolling if ( dy \> 10 ) then scrollView:takeFocus( event ) end end return true

Thanks!  I’ll give that a try – I think it’ll do the trick.

Thanks JWiow, that did the trick.