Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to hide webView in composer when switching to another scene
Started by eto_ru Dec 13 2018 04:05 AM

2 replies to this topic

Best Answer Rob Miracle , 13 December 2018 - 11:42 AM

In the scene you're departing from's scene:hide() function set the webView's isVisible to false, or just remove it 

function scene:hide( event )
    if event.phase == "will" then
         myWebView.isVisible = false
         -- or 
         myWebView:removeSelf()
         myWebView = nil
    end
end

assuming your webView is named "myWebView" and that you declared the webView local at the top of the scene and not inside the function you're creating it in.

 

Rob

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

eto_ru

[GLOBAL: userInfoPane.html]
eto_ru
  • Enthusiast

  • 35 posts
  • Corona SDK

How to hide webView in composer when switching to another scene?



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,154 posts
  • Corona SDK

  Best Answer

In the scene you're departing from's scene:hide() function set the webView's isVisible to false, or just remove it 

function scene:hide( event )
    if event.phase == "will" then
         myWebView.isVisible = false
         -- or 
         myWebView:removeSelf()
         myWebView = nil
    end
end

assuming your webView is named "myWebView" and that you declared the webView local at the top of the scene and not inside the function you're creating it in.

 

Rob


  • eto_ru likes this

[TOPIC: post.html]
#3

eto_ru

[GLOBAL: userInfoPane.html]
eto_ru
  • Enthusiast

  • 35 posts
  • Corona SDK

Thank You!




[topic_controls]
[/topic_controls]