Is there a way to change the color of the gray underside of the UIWebView that's seen when the page is overscrolled?
Asked
Active
Viewed 5,165 times
2 Answers
11
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

Naveed Ahmad
- 6,627
- 2
- 58
- 83

Loren
- 973
- 8
- 10
-
1Did you try this? webView.backgroundColor = [UIColor whitwColor]; does not work for me – Alan Mar 18 '09 at 01: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 01: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 07: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
-
Got the same behavior like Bogatyr – Martin Reichl Oct 11 '11 at 12:06
1
[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;
}
}
}

Nate
- 31,017
- 13
- 83
- 207

Martin Reichl
- 932
- 9
- 13