UIWebView enhancements

Here are a few simple UIWebView enhancements for iPhone/iPad apps.
The default WebView background color is plain grey. This to me is very boring. Unlike standard elements, the webView’s background cannot be changed.
To change the background color of a webView, type the following in your application’s .m file:

webView.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];

That will change the background color to the iOS4 folder background color. Notew that this textured color is only avaliable in iOS 3.2+.
You could also replace scrollViewTexturedBackgroundColor with whiteColor, redColor ect… To find all the colors avalible in Xcode, tupe UIColor then press escape. You will be presented with a list of them.

Leave a Comment