Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to display loading message when invoking a native.newWebView
Started by francoamat May 13 2018 08:58 AM

5 replies to this topic
native.newwebview loading message
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

francoamat

[GLOBAL: userInfoPane.html]
francoamat
  • Observer

  • 2 posts
  • Corona SDK

Good morning to the whole community. I have a ploblem to solve: when I invoke native.newWebView it takes some time before the external web page is shown. I would like to show a message using for example display.newSprite that shows me that the page is loading. Use composer.newScene to recall the scene that will display the web page. How can I solve? Thanks in advance

Good morning to the whole community. I have a ploblem to solve: when I invoke native.newWebView it takes some time before the external web page is shown. I would like to show a message using for example display.newSprite that shows me that the page is loading. Use composer.newScene to recall the scene that will display the web page. How can I solve? Thanks in advance



[TOPIC: post.html]
#2

remiduchalard

[GLOBAL: userInfoPane.html]
remiduchalard
  • Contributor

  • 301 posts
  • Corona SDK

Hello,

 

Is it normal that you have written two times the same text?

To resolve your problem it's simple. Display your loading things and then call for example with a timer (0 ms) invoke what you want.



[TOPIC: post.html]
#3

francoamat

[GLOBAL: userInfoPane.html]
francoamat
  • Observer

  • 2 posts
  • Corona SDK

Hello remiduchalard.

 For the double message I did not realize that I had duplicated. How should I use timer could you give me an example?



[TOPIC: post.html]
#4

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 1,840 posts
  • Corona SDK

Load your webView offscreen and then when it is loaded simply transition it on screen.  Look at the docs for webListener events to make this happen.

 

If you want to show an animated "loading" that's fine you simply display it, load webView, once loaded shows webView and kill "loading".



[TOPIC: post.html]
#5

remiduchalard

[GLOBAL: userInfoPane.html]
remiduchalard
  • Contributor

  • 301 posts
  • Corona SDK

MyDisplaymessage=display.newImage(...)

local function myLoading()

   load your webview
   and display it when it's totally load
end

timer.performWithDelay( 1, myLoading)

@SGS purpose a better solution



[TOPIC: post.html]
#6

dodi_games

[GLOBAL: userInfoPane.html]
dodi_games
  • Contributor

  • 235 posts
  • Corona SDK

@remiduchalard

I will do what SGS propose. But you can make an sprite animation simulating a loading and when the listener finish load the webview, pause an make invisible the loading FX. I have never do it I'm just thinking and trying to help.


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: native.newwebview, loading message