UIWebView* transWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; NSString* innerHTML = @"<span style=\"color: #F00;\">hogehoge</span>"; NSString* outerHTML = @"<body style=\"background-color: transparent\">%@</body>"; NSString* htmlString = [NSString stringWithFormat:outerHTML, innerHTML]; [transWebView setBackgroundColor:[UIColor clearColor]]; [transWebView setOpaque:NO]; [
![UIWebViewの背景を透明にしてみよう!](https://cdn-ak-scissors.b.st-hatena.com/image/square/06a15c64ba0ceec233d86d71001ebb29a9dcbf5d/height=288;version=1;width=512/https%3A%2F%2Fcdn.blog.st-hatena.com%2Fimages%2Ftheme%2Fog-image-1500.png)