cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Velecký <>
Subject Re: Change background color of Android Cordova app
Date Fri, 18 Jul 2014 09:19:31 GMT

It's so simple reproduce this even without opacity. Simply make new Android 
Cordova project.

Add this to css to make clear that css doesn't play any role here:

* {
    background-color: black !important

Then infest <body> with HTML code from and ideally 
form code. Copy it and hold paste for 10 seconds for example at <body> to 
make DOM very big, then this problem will be well visible, when you do 
rotate to landscape mode.

And finally, add <preference name="BackgroundColor" value="0xff000000"/> to 
config.xml which does nothing...

That is it. Stupid simple to reproduce this.


Delay the loading of the URL without a screenshot? Also, you could run the 
manual test application in test that's marked "Test Background Color". This 
isn't automated because it would require the inclusion of a third party 
library like Robotium, and there's no way to programmatically test the 
colour blue that's worth writing. (Seriously, it'd be yet another library 
that'd take the screenshot within the 2 second delay, and then process the 
image to see if the pixels are blue, a non-trivial amount of work for 
something that someone can do when they need to.) 

On Thu, Jul 17, 2014 at 8:23 AM, Andrew Grieve <> wrote:

I did it to test whether the backgroundColor preference was working. Do you 
know another way to test that preference? 

On Thu, Jul 17, 2014 at 11:12 AM, Joe Bowser <> wrote: 

So, this is only an issue if you set the html tag opacity to 0? Why would 
anyone do this? 

On Thu, Jul 17, 2014 at 7:56 AM, Andrew Grieve <> wrote:

Try setting opacity:0 on the <html> tag and you can reproduce white showing 
instead of your backgroundColor. 

On Thu, Jul 17, 2014 at 10:54 AM, Joe Bowser <> wrote: 

The WebView element isn't supposed to have the backgroundColor, it's the 
view behind the WebView that's supposed to have the backgroundColor. 

Also, I haven't seen this behaviour on any of the tests that we done. Unless
we can reproduce the issue, we can't fix it, and shouldn't just throw things
over the wall. 

On Thu, Jul 17, 2014 at 7:46 AM, Andrew Grieve <> wrote:

I was actually looking at this recently and found that the backgroundColor 
preference is not being applied to the actual WebView element. Didn't want 
to change it because I was changing other things at the time, but likely 
this is just a bug that we should fix. 

Filed an issue:

On Thu, Jul 17, 2014 at 9:56 AM, Sergey Grebnov (Akvelon) < v-se...@> wrote: 

I suppose this could be done by backgroundColor preference (config.xml) 

<preference name="backgroundColor" value="0xFFF" /> 

Thx! Sergey 

-----Original Message----- From: Jan Velecký [] Sent:
Thursday, July 17, 2014 4:18 PM To: Subject: Change
background color of Android Cordova app 

Hello, how can I change background color, which is visible during 
orientation change until WebView is correctly resized. I specified it more 
at http://


But, it look stackoverflowers don't know solution to this problem, so I post
it here. :-) 

I hope, someone have had different problem ;-) 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message