Can a WebView have a transparent background?

barx

Well-Known Member
Licensed User
Longtime User
Hi all,
as per title, can a webview be transparent.

Currently setting background color within the html, but is there a way for it to be clear.

Cheers
 

DannyRyan

Member
Licensed User
Longtime User
Has anyone managed to get this working at all?

when i try the following:
B4X:
WebView1.Color(Colors.Transparent)

If errors with the following:
B4X:
Compiling code.                         Error
Error compiling program.
Error description: Property: Color is writeonly.
Occurred on line: 53
WebView1.Color(Colors.Transparent)
Word: color
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Just to re-light this old flame. I have the webview on a black background and when the activity first loads the webview flashes up white, then goes changes color to the required color. Is there anyway to stop the white?

I've tried hiding the wv > changing color > loading content > showing wv. Still does it. Even slipped a DoEvents in there to see if it helps. No joy.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Think I may have sorted it now. Turns out it's a known bug in Andoid. Need to turn off hardware acceleration. I have currently done this application wide for testing, but it can be set per view with the following (in java)

B4X:
myView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Question is, seems though this isn't available in b4a, how would one achieve this with reflector?
 
Upvote 0
Top