Can't change background for UIWebView in iPhone SDK

Posted by leon on Stack Overflow See other posts from Stack Overflow or by leon
Published on 2009-10-10T05:01:35Z Indexed on 2010/03/12 13:17 UTC
Read the original article Hit count: 808

Filed under:
|
|

Hi,

Is there a way to change background color for UIWebView? None of the colors set in IB effect UIWebView behavior: before acctual content is loaded it shows as up as white (causing a white flash between the moment it is loaded and content is rendered).

Setting background color programmatically does not do anything either. Here is code:

@interface Web_ViewViewController : UIViewController {

UIWebView *web;
}

@property (nonatomic, retain) IBOutlet UIWebView *web;
@end

.... 
(void)viewDidLoad {
super viewDidLoad;

web.backgroundColor = UIColor blueColor;
NSURL *clUrl = NSURL URLWithString:@"http://www.apple.com" ;
NSURLRequest *req = NSURLRequest requestWithURL:clUrl;

web loadRequest:req;

}

thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about SDK