Is there a way to change the color of the gray underside of the UIWebView that's seen when the page is overscrolled?
Just set the backgroundColor
property.
Below I mentioned swift 3 syntax, currently instead of Color, Xcode is providing color plate for mentioning color
webview.backgroundColor = Color.white
-
1Did you try this? webView.backgroundColor = [UIColor whitwColor]; does not work for me – Alan Mar 18 '09 at 1:47
-
You may need to post your code, because setting the background color as described here works fine (at least in 2.2.1). – ddoughty Mar 23 '09 at 1:38
-
1Wow, this is odd. Setting the background color in the IB didn't seem to work, but doing it in code had the desired effect. Thanks! – Simon Aug 13 '10 at 7:14
-
3Adding self.myWebView.backgroundColor = [UIColor whiteColor]; just replaced the dark grey gradient with a light white/grey gradient. Is there a way to set the overscrolled area to a flat solid color? – Bogatyr Aug 23 '10 at 20:33
-
[self.webView setBackgroundColor:[UIColor clearColor]];
for(UIView* subview in [self.webView1 subviews]){
if([subview respondsToSelector:@selector(setBackgroundColor:)]){
[subview setBackgroundColor:[UIColor clearColor]];
}
for(UIView* imageView in [subview subviews]){
if([imageView isKindOfClass:[UIImageView class]]){
imageView.hidden = YES;
}
}
}