Quote:
Originally Posted by csmithmaui
I just made a webview transparent the other day.
Here is what I did:
first set the background color of the webview to clear:
myWebView.backgroundColor = [UIColor clearColor];
then in your html file use css syntax:
<body style="background-color:transparent">
I actually did it in the <head> section but that should work too.
Hope that helps you...it worked for me.
csmithmaui
|
Does this still work in 2.2? I tried it in the simulator and on the device, I can't get it to work on any of them.
I got:
Code:
[self setHeaderStr:[[NSMutableString alloc] initWithString:@"<html>...<body style=\"background-color:transparent;\">"]];
Code:
[webView setBackgroundColor:[UIColor clearColor]];
[webView setDelegate:self];
[webView loadHTMLString:[NSString stringWithFormat:@"%@%@", headerStr, bodyStr] baseURL:[NSURL URLWithString:@"..."]];