please help: NativeWebView and ShowWebPopup

Hi ,

is there any way to know whats the content either in the nativeWebView or the showWebPopup

also anyway to put something on Top of them (for example a CloseButton)??

i get sometimes an empty html page in my WebView / popup and than i would need

to close the WebView/Popup …

but how could I do that simple

thanks

chris

Hi Chris,

I had the same problems. On checking with Corona sdk docs, i found that WebView is displayed on top of every other display object like buttons, images etc. So placing a close button on top of it did not work for me. Maybe there is another way but till then i used a WebPopup because of two reasons:-

  1. WebPopup automatically closes on back button press on the device

  2. It can be closed via code using the native.cancelWebPopup( ) function

I wanted to display an html page with a close button in the shape of a small circular button on top right hand corner of the html page. The code below shows what i did

-- i called this function on a button press, since the button press event is a tap event -- so i do not check for event.phase == "began" or "ended" local function doSomething()     -- i left 100 units of height from the top of the screen to display the close button     webview = native.showWebPopup( 0, 100, display.contentWidth, display.contentHeight, url)     btnClose.isVisible = true -- this is the button which closes the WebPopup end -- this function is called on clicking the close button -- close button is created via widget library local function closeWV()     native.cancelWebPopup( )     btnClose.isVisible = false end  

Hope it helps a bit!

Hi Chris,

I had the same problems. On checking with Corona sdk docs, i found that WebView is displayed on top of every other display object like buttons, images etc. So placing a close button on top of it did not work for me. Maybe there is another way but till then i used a WebPopup because of two reasons:-

  1. WebPopup automatically closes on back button press on the device

  2. It can be closed via code using the native.cancelWebPopup( ) function

I wanted to display an html page with a close button in the shape of a small circular button on top right hand corner of the html page. The code below shows what i did

-- i called this function on a button press, since the button press event is a tap event -- so i do not check for event.phase == "began" or "ended" local function doSomething()     -- i left 100 units of height from the top of the screen to display the close button     webview = native.showWebPopup( 0, 100, display.contentWidth, display.contentHeight, url)     btnClose.isVisible = true -- this is the button which closes the WebPopup end -- this function is called on clicking the close button -- close button is created via widget library local function closeWV()     native.cancelWebPopup( )     btnClose.isVisible = false end  

Hope it helps a bit!