Hello. I’m using a tabbar for navigating scenes in a storyboard. in a scene, I have a webview. When I change scenes the webview stays up. The scene group is removed and all that was inserted into it, but I can’t get rid of the webview. I have this code in that scene:
function scene:createScene( event ) local group = self.view local screen\_adjustment = 1 local background = display.newImage("assets/top.jpg", true) background.anchorX, background.anchorY = 0, 0 background.xScale = (screen\_adjustment \* background.contentWidth)/background.contentWidth background.yScale = background.xScale background.x = 0 background.y = 0 group:insert( background ) local webView = native.newWebView( 0, 0, display.contentWidth, display.contentHeight - 350 ) webView:request( "assets/2.html", system.ResourceDirectory ) webView.anchorX, webView.anchorY = 0, 0 webView.x = 0 webView.y = 130 group:insert( webView ) end function scene:exitScene(event) print( "exitScene called." ) local group = self.view native.cancelWebPopup() storyboad.remove (webView) display.remove (webView) group.remove ( webView ) if webView then webView.parent:remove(webView) webView = nil end webView:removeSelf() webView = nil end
but I notice the print statement is never called. The exitScene isn’t being called?
In my main.lua where the tabbar is created I tried this too:
local tabButtons = { { width = 175, height = 155, defaultFile = "assets/1\_practices.png", overFile = "assets/1\_practices\_on.png", onPress = function() storyboard.removeAll() storyboard.gotoScene( "screen1" ); end, selected = false }, ...
but that didn’t kill it either.
Any ideas? I’m running out of guesses.