mrugen munshi
mrugen munshi

Reputation: 3607

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

Upvotes: 2

Views: 719

Answers (1)

Vivi
Vivi

Reputation: 972

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

Upvotes: 5

Related Questions