webView gray loading screen

I’m finding good usage for the native webView.

However, the gray loading screen looks a bit unsightly in my app. Is there a way to change the color or make it transparent?

Thanks!

Might want to check http://feedback.coronalabs.com and see if there is an entry for this. There are several webView things that are multiple feature posts, but I don’t know if this is one.  Feel free to vote up any existing items or create a new one.

Rob

I checked but didn’t see it- so I added it to the list.

Seems like it would be such an easy thing to do. I hope it gets noticed.

Thanks for your reply Rob

Here is the feedback request if others want to vote on it.

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/11452152-ability-to-change-color-of-gray-loading-screen-in

Rob

Thanks Rob,

Okay, if anyone is interested, I have come up with a workaround for this.

Rob, maybe you can give this a glance and tell me if I’m missing something but this does work in my tests:

[lua]

local function webListener( event )

    if event.type == “loaded” then

        transition.to( webView, { time=600, alpha=1 } )

        transition.to( loading, { time=400, alpha=0 } )

    end

    if event.errorCode then

        native.showAlert( “Error!”, event.errorMessage, { “OK” } )

    end

end

loading = display.newImageRect( “loading.png”, 123, 57 )

loading.x = _SCREEN.CENTER.X

loading.y = 192

–Inside of the Composer “will” show function

webView.alpha = 0

webView:addEventListener( “urlRequest”, webListener )

[/lua]

In short, I created my own loading graphic to show and hid the webView.

Once we have a successful page load, I phase out the loading graphic and phase in the webView.

This allows you to put an animation or something more entertaining instead of a boring gray loading screen.

Might want to check http://feedback.coronalabs.com and see if there is an entry for this. There are several webView things that are multiple feature posts, but I don’t know if this is one.  Feel free to vote up any existing items or create a new one.

Rob

I checked but didn’t see it- so I added it to the list.

Seems like it would be such an easy thing to do. I hope it gets noticed.

Thanks for your reply Rob

Here is the feedback request if others want to vote on it.

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/11452152-ability-to-change-color-of-gray-loading-screen-in

Rob

Thanks Rob,

Okay, if anyone is interested, I have come up with a workaround for this.

Rob, maybe you can give this a glance and tell me if I’m missing something but this does work in my tests:

[lua]

local function webListener( event )

    if event.type == “loaded” then

        transition.to( webView, { time=600, alpha=1 } )

        transition.to( loading, { time=400, alpha=0 } )

    end

    if event.errorCode then

        native.showAlert( “Error!”, event.errorMessage, { “OK” } )

    end

end

loading = display.newImageRect( “loading.png”, 123, 57 )

loading.x = _SCREEN.CENTER.X

loading.y = 192

–Inside of the Composer “will” show function

webView.alpha = 0

webView:addEventListener( “urlRequest”, webListener )

[/lua]

In short, I created my own loading graphic to show and hid the webView.

Once we have a successful page load, I phase out the loading graphic and phase in the webView.

This allows you to put an animation or something more entertaining instead of a boring gray loading screen.