【发布时间】:2014-09-21 08:12:50
【问题描述】:
我正在使用 UIWebView 从 plist 加载一些 HTML 文本。
我设法使它的背景透明使用
webView.opaque = NO;
webview.backgroundColor = [UIColor clearColor];
但是内容,即从 plist 加载的文本,显示为令人不安的白色背景。
我正在使用
加载它NSString *descr = [NSString stringWithFormat:@"<html><head><style> body{font-size:16; font-family: Helvetica; color: black;} strong{font-family: Arial; font-weight: bold; font-size:16} .bg{background:transparent;}</style></head><body><div class='bg'>%@</div></body></html>",[item valueForKey:@"description"]];
[webView loadHTMLString:descr baseURL:nil];
我尝试将 .bg 类背景颜色设置为 rgba(255,0,0,0.0),但没有任何效果。
也试过设置webView.scrollView.backgroundColor : [UIColor clearColor];
关于如何让 UIWebView 的内容背景透明的任何建议?
【问题讨论】:
标签: ios css objective-c uiwebview