UIWebView background color

六月ゝ 毕业季﹏ 提交于 2019-12-02 16:29:55
Kal

Set the background color in your html itself using css markup.

Or, set the webview's opaque property to NO .. and set the background of the view underneath to green.

UIWebView themselves don't seem to understand background color-- since they are rendering documents.

Use this an addition to your code

[myWebView setBackgroundColor:[UIColor greenColor]];
[myWebView setOpaque:NO];
[myWebView loadHTMLString:myString baseURL:nil];
webView.opaque = NO;
webView.backgroundColor = [UIColor clearColor];

Tested in Xcode8 and Swift 3

self.webView.isOpaque = false;
self.webView.backgroundColor = UIColor.clear
harish babu
UIWebView *webview =[[UIWebView alloc];

[webview setBackgroundColor:[UIColor whiteColor]];
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!