0

I have a UIWebView displaying an iFrame, I have the webview set to clear color, and the iFrame set to transparent, but for some reason I am still getting a white block instead of a clear iFrame. Is there something else I need to do ?

iFrame Code:

<iframe src=\"http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FmySite&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=31301291871XXXX\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:125px; height:40px;\" allowTransparency=\"true\"></iframe>

iOS code:

NSString *likeButtonHtml = [NSString stringWithFormat:@"<HTML><BODY>%@</BODY></HTML>", likeButtonIframe];   

UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(650, 95, 125, 40)];

[webView setBackgroundColor:[UIColor clearColor]];
[webView loadHTMLString:likeButtonHtml baseURL:[NSURL URLWithString:@""]];

[self.view addSubview:webView];

Thank you for the assistance.

Nathan
  • 1,609
  • 4
  • 25
  • 42

1 Answers1

3

Try this:

webView.opaque = NO;

You may also need this on your HTML:

<style>body {background-color: transparent;}</style>
André Morujão
  • 6,963
  • 6
  • 31
  • 41