今天想改一下WebView的背景色,使用了
如下两种常规的修改背景色的方法都不行
tintWebView.backgroundColor = [UIColor greenColor];
或
tintWebView.scrollView.backgroundColor = [UIColor greenColor];
后来找到解决方法:
使用
[tintWebView setBackgroundColor:[UIColor redColor]];
[tintWebView setOpaque:NO];//加上这一句就能修改背景色
原文:http://www.cnblogs.com/guatiantian/p/3940873.html