I created a app for load remote html file in my view, but after loaded the html file I cant remove the “webview” below my code:
local topweb = display.screenOriginY + display.statusBarHeight + 50
function listenerLink(event)
webView = native.newWebView(0 , 0, display.contentWidth, display.contentHeight - topweb)
webView:request( “http://myurl.com/myfile.html”)
webView:setReferencePoint(display.TopLeftReferencePoint)
webView.x = display.screenOriginX
webView.y = topweb
return true
end
linktoUrl= display.newText(“View link”, 0, 0, native.systemFont, 14)
linktoUrl:setTextColor(0, 0,0)
linktoUrl:addEventListener(“touch”, listenerLink)
function backBtnRelease( event )
webView:removeSelf()
webView = nil
end
– back button
local backBtn = ui.newButton{
default = “images/back_button.png”,
over = “images/back_button_over.png”,
onRelease = backBtnRelease
}
backBtn:setReferencePoint(display.TopLeftReferencePoint)
backBtn.x = display.screenOriginX
backBtn.y = display.screenOriginY