简体   繁体   中英

how to make clear colour in uiwebview

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.

thanks

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;}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM