Display web view with transparent background

I am showing some graph from a link in a webview.

My requirement: I want to show a graph with a changed background color.

One way is to change the color in the html / php code.

Another way that I thought was to view the web view in the NSBox and fill the NSBox with the desired color, but it does not work as needed. It shows a graph with white background color in a web view and an NSBox with filled color around it.

Is there any way by which you can make the background of the WebView transparent so that it displays the color of the window in which it is contained as the background color of the graph?

Thank,

Miraaj

+3
source share
1 answer

Yes, try the following:

[myWebView setOpaque:NO];
[myWebView setBackgroundColor:[UIColor clearColor]];
+4
source

Source: https://habr.com/ru/post/1762612/


All Articles