Changing the background colour of a Web Popup

I’m using the web popup to display some remote content in a client app and they want it to look as native as possible however the web popup has a light grey gradient behind it when you scroll to far up or down. I have set hasBackground to false. Is there any way to specify the colour of it or is it a webkit thing? [import]uid: 5833 topic_id: 6492 reply_id: 306492[/import]

You can control it with HTML and CSS. Once you have the web popup it’s like any other html file. You can import XMl using an httpXMLRequest object etc. [import]uid: 8045 topic_id: 6492 reply_id: 22472[/import]

Sorry that’s not quite what I meant, I don’t think I explained it very well. It’s not the actual page that loads that has the grey bit it’s the bit “behind” the web view, i.e. if you scroll the page to far down or up it’s the bit that gets revealed. Unless that is part of it and I’m just way off the mark.

I set the background of the page to red using CSS just to test it and that didn’t fix it (it set the page, just not the bit I want) so I’m guessing it is a webkit or Corona thing.

It’s hard to take a screen shot of it so I went lo-fi, the result is here - http://dl.dropbox.com/u/571145/IMAG0548.jpg

Please excuse the horrible web page, it is very much placeholder. [import]uid: 5833 topic_id: 6492 reply_id: 22479[/import]

Ah ok :smiley:

lol…

Erm, that’s a good question. I have no clue. I’ve got my Corona and my other Corona (beer) and will take a look. This looks interesting.

…sip…

[import]uid: 8045 topic_id: 6492 reply_id: 22480[/import]

It’s time to fix code and drink beer…but I’m all out of beer :frowning:

But seriously, thank you for taking a look, very much appreciated.

P.S. While I have you here, do you know how I can remove a webview? [import]uid: 5833 topic_id: 6492 reply_id: 22481[/import]

To get rid of the webview you need to call the function:
native.cancelWebPopup() before you load the screen.

I notice you are using the Tab bar. In the main.lua file, the showScreen function captures the event id. Add the native.cancelWebPopup() there before the call to loadScreen(“yourscreen”).

If you just want to close the web popup and get the results of the form as a querystring you can need to add:

[lua]

For example:



…html input field etc.

[/lua]

When you hit submit, it will pass a set of name/value pairs to Corona where it can be consumed into a SQLite db or even a .txt file.

[import]uid: 8045 topic_id: 6492 reply_id: 22485[/import]

You know what, I have been up far too long. I actually saw that function in the API and remember thinking to myself “Yup, remember that one. Will need that later” then must have completely forgotten about it. Thank you very much. [import]uid: 5833 topic_id: 6492 reply_id: 22486[/import]

For the scroll part check this thread out:
http://developer.anscamobile.com/forum/2011/01/26/web-pop-additional-features

Building429 posted a link about partway in the 3rd post.

That is where I got this:
http://cubiq.org/iscroll

The iScroll says:
“The overflow:scroll for mobile webkit. Project started because webkit for iPhone does not provide a native way to scroll content inside a fixed size (width/height) div. So basically it was impossible to have a fixed header/footer and a scrolling central area. Until now.”

I haven’t tried it but you can take a look at an online sample at:
http://cubiq.org/dropbox/iscroll/index.html?v=3.7.1

Notice everything else moves except the top part. It will most likely hide that gray background when calling the web popup.

[import]uid: 8045 topic_id: 6492 reply_id: 22490[/import]

For the scroll part check this thread out:
http://developer.anscamobile.com/forum/2011/01/26/web-pop-additional-features

That is where I got this:
http://cubiq.org/iscroll

The iScroll says:
“The overflow:scroll for mobile webkit. Project started because webkit for iPhone does not provide a native way to scroll content inside a fixed size (width/height) div. So basically it was impossible to have a fixed header/footer and a scrolling central area. Until now.”

I haven’t tried it but you can take a look at an online sample at:
http://cubiq.org/dropbox/iscroll/index.html?v=3.7.1

Notice everything else moves except the top part. It will most likely hide that gray background when calling the web popup.

[import]uid: 8045 topic_id: 6492 reply_id: 22492[/import]

hmmm…more forum weirdness.

Sorry for the double post. It looks like either the server is super busy again or replies are being queued somehow.

weird. [import]uid: 8045 topic_id: 6492 reply_id: 22494[/import]

That looks perfect! Thank you very much. [import]uid: 5833 topic_id: 6492 reply_id: 22495[/import]

No problems for the double post, my record so far was a triple post. The servers to seem to play up fairly often. [import]uid: 5833 topic_id: 6492 reply_id: 22496[/import]