So when i add a widget.newButton into my scrollView and click on it and try to scroll it doesn’t scroll.
Here’s a sample.
Simulated in a border-less android 1080x1920.
local widget = require( "widget" ) local function scrollListener( event ) local phase = event.phase local direction = event.direction if "began" == phase then --print( "Began" ) elseif "moved" == phase then --print( "Moved" ) elseif "ended" == phase then --print( "Ended" ) end -- If the scrollView has reached its scroll limit if event.limitReached then if "up" == direction then --print( "Reached Top Limit" ) elseif "down" == direction then --print( "Reached Bottom Limit" ) elseif "left" == direction then --print( "Reached Left Limit" ) elseif "right" == direction then --print( "Reached Right Limit" ) end end return true end local scrollView = widget.newScrollView { x = display.contentCenterX, y = display.contentCenterY, width = display.actualContentWidth, height = display.actualContentHeight, horizontalScrollDisabled = true, listener = scrollListener } local box = widget.newButton { x = display.contentCenterX, y = display.contentCenterY, shape = "rect", width = 100, height = 100, } box:setFillColor( 1, 0, 0 ) scrollView:insert(box)
Thanks for an advice!
–SonicX278