我想要的是将webview的背景颜色设置为透明。
下面是我用于 webview 的代码。
NSString *embedHTML = [NSString stringWithFormat:@"<html><body style=\"background-color: transparent;font-family: verdana;\"><h3>About US</h3></BODY></HTML>"];
[webView loadHTMLString:embedHTML baseURL:nil];
但是当我使用它时,我仍然看到背景颜色为白色。知道如何让颜色变得透明吗?
最佳答案
这就是它应该做的,
[webView setBackgroundColor:[UIColor clearColor]];
[webView setOpaque:NO];
关于iOS : WebView Background color to transparent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13428706/