This worked fine for me with widget 1.0
local function webListener(event) if event.phase == "moved" then local dx = math.abs( event.x - event.xStart ) local dy = math.abs( event.y - event.yStart ) -- if finger drags button more than 5 pixels, pass focus to scrollView if dx \> 5 or dy \> 5 then contenedor:takeFocus( event ) end elseif event.phase == "ended" then print( "toca webView" ) end return true end function establecemento:createScene( event ) local grupoEstablecemento = self.view local fondo = display.newRect(0,0,anchoVisible,altoVisible) fondo:setFillColor(255) contenedor = widget.newScrollView { width = anchoVisible, height = altoVisible, scrollWidth = anchoVisible, scrollHeight = 1600, bottomPadding = 150, hideBackground = true, hideScrollBar = true, horizontalScrollDisabled = true, } webView = native.newWebView( 10, 724, 1004, 400 ) webView:setReferencePoint(display.TopLeftReferencePoint) webView.x = anchoVisible/2 - webView.width/2 webView.y = 400 webView.hasBackground = false webView:request( "proba.html", system.DocumentsDirectory ) webView:addEventListener( "urlRequest", webListener ) grupoEstablecemento:insert(fondo) grupoEstablecemento:insert(contenedor) end
And the scroll doesn’t works right since widget 2.0 (stops the scroll when finger drags over the webview)
Maybe a problem with newWebView?