开发者

how to make clear colour in uiwebview

开发者 https://www.devze.com 2023-01-16 04:49 出处:网络
I am having a UIWebView and I want to make it transperent as I have image in background in the Imageview. I tried webView.backgroundColor = [UIColor clearColor]; but it didn\'t work.

I am having a UIWebView and I want to make it transperent as I have image in background in the Imageview. I tried webView.backgroundColor = [UIColor clearColor]; but it didn't work.

tha开发者_如何学运维nks


It should work; make sure the webview is not opaque.

[myWebView setBackgroundColor:[UIColor clearColor]];
[myWebView setOpaque:NO];

You also have to check that your HTML content does not set a background color for the body tag.

body{background-color:transparent;}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号