iOS:WebView将背景颜色设置为透明(iOS : WebView Background color to transparent)
我想要的是将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];但是,当我使用这个,我仍然看到背景颜色为白色。 任何想法如何让颜色透明?
What I want is set the background color of webview to transparent.
Below is the code I am using for 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];However when I use this, I still see background color as WHITE. Any idea how to get color to transparent?
最满意答案
这是它应该采取的一切,
[webView setBackgroundColor:[UIColor clearColor]]; [webView setOpaque:NO];This is all it should take,
[webView setBackgroundColor:[UIColor clearColor]]; [webView setOpaque:NO];更多推荐
webview,transparent,embedHTML,颜色,电脑培训,计算机培训,IT培训"/> <meta name=&q
发布评论