If turn on multitouch
system.activate("multitouch");
in this code:
local widget = require( "widget" ) local scrollView = widget.newScrollView { top = 100, left = 10, width = 300, height = 400, scrollWidth = 600, scrollHeight = 800, horizontalScrollDisabled = true } -- The touch listener function for the button (created below) local function handleButtonEvent( event ) 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 end local button1 = widget.newButton { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } scrollView:insert( button1 )
than handleButtonEvent won’t work! It’s impossible to tap button.
Be careful, guys.