Page 1 of 1

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

Posted: Thu Sep 03, 2015 10:43 am
by Miguel Navarro7469744

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...


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

Posted: Thu Sep 03, 2015 4:23 pm
by Miguel Navarro7469744

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.


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

Posted: Fri Sep 04, 2015 1:20 pm
by Serhii Kulibaba

Hello Muguel,

Please look this topic: https://getsatisfaction.com/apperyio/...


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

Posted: Fri Mar 25, 2016 5:47 pm
by Miguel Navarro7469744

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.