Miguel Navarro7469744
Posts: 0
Joined: Mon Apr 06, 2015 4:55 pm

Changing background color of webview (when using window.location)

Because all my pages are separate (not spa) I have navigation issues where pages are not located unless I use window.location to load/link to a page. Because of this I get an annoying white background ... which is I'm guessing the default color of the webview when linking from page to page, particularly now that I've changed the app color to used a dark theme.

I have tried setting the backround color in preference in the config.xml file but this seems to only work for the splash.

Is there a way to do this in appery, modify or create a class to do it within the source files?

This thread talks about something similar:

http://stackoverflow.com/questions/18...

Miguel Navarro7469744
Posts: 0
Joined: Mon Apr 06, 2015 4:55 pm

Changing background color of webview (when using window.location)

I will just add that my pages were not changing correctly using
mobile.pageChange. I was testing the function:

Code: Select all

$.mobile.pageContainer.pagecontainer("change", page + ".html",  { 
       allowSamePageTransition : true, 
       transition              : 'none', 
       showLoadMsg             : false, 
       reloadPage              : true 
     }); 

Which seems to work much better. I still have an issue for specific pages that have a javascript (slick) carousel. So I still am using window.location for these pages. I'm ok with this if somehow I can eliminate the white page between navigation.

Miguel Navarro7469744
Posts: 0
Joined: Mon Apr 06, 2015 4:55 pm

Changing background color of webview (when using window.location)

Ok guys if you ever come across this issue the way to do it is:

For android go to source/app_name/res/xml/config.xml and add a preference
for example:

code
<preference name="BackgroundColor" value="00000000"/>
/code

the first hex value is the alpha channel so this is a transparent black background.

Return to “Issues”