Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone - changing UIWebView background color behind the view (bouncing background)

I have a UIWebView with a black content. All my views and subviews are set to black background.

When scrolling the webView to its top or bottom position, I can see a white background appear while the content is bouncing. So how may I force that background also to be black ?

like image 303
Oliver Avatar asked Oct 17 '11 01:10

Oliver


2 Answers

Set webview color to clearcolor add then webview opaque to no.

webview.backgroundColor = [UIColor clearcolor];
webview.opaque=NO;

That will do the trick.

like image 127
kalyan711987 Avatar answered Oct 26 '22 18:10

kalyan711987


Are you sure all your subviews are set to black? Setting the webview's background color to black should work just fine. (It works in my app, if it doesn't work for you, I'll have to check if I do something else...)

webview.backgroundColor = [UIColor blackColor];
like image 34
voidStern Avatar answered Oct 26 '22 20:10

voidStern