Web View background colour

barx

Well-Known Member
Licensed User
Longtime User
I have a webview on a black background and use the following code to show a image AND channge the background color to black to match the rest of the activity.

B4X:
strHTML = "<html><body bgcolor = #000000><img src='file:///android_asset/selectarrow.png' /><br /><h1><font color=#444444>Tap to Select</font></h1></body></html>"
WebBody.LoadHtml(strHTML)
WebBody.Visible = True

When the activity is loaded the webview flashes white for a split second the goes black as required. I'd hoped that making .visible = false (done in designer), loading the html, then making it visible again would avoid this happening but it still shows. How would one avoid this. Would I have to implement a timer to delay the visibility by say 500ms?

cheers
 

barx

Well-Known Member
Licensed User
Longtime User
Ahh, didn't think of changing colour of the actual webview. I'm so dumb at time :signOops:

All sorted now though cheers Dude
 
Upvote 0

reikhard

Member
Licensed User
Longtime User
How can I change the font color? for example : the default is white background color, the text is black. I need to change it to black background and white font. Should I load the html with a define color for the font in this case white font. I dont want to create a different html for each file... Any ideas? Please?
 
Upvote 0
Top