Remove the white background for UIWebview

This is a simple tip for removing the white background for UIWebView.

The problem appear when you load a local html file or a request to display a web page, it takes a couple of millisecond until the white background disappear.

We are fine with it as a developer, but some of the customer may get upset to see it, so i’ve searched for a solution and with some of luck i found it, the solution is simple, you just have to add this piece of code in viewDidLoad to remove the white background


[webView setOpeque:NO];
[webView setBackgroundColor:[UIColor clearColor]];


This is it, the problem is solved.

stay tuned for the next topic.

Mumen Shabaro.