简体   繁体   English

如何更改UIWebView滚动的背景?

[英]How to Change Background of UIWebView Scrolling?

in the iPhone SDK Interface Builder, any UIWebView has a default gray background that is shown when the view has been scrolled too far. 在iPhone SDK Interface Builder中,任何UIWebView都有一个默认的灰色背景,当视图滚动得太远时会显示该背景。 Is it possible to change this background color so it doesn't look so obvious? 是否可以更改此背景颜色,使其看起来不那么明显? The gray conflicts with my App :( Any help would be greatly appreciated. 灰色与我的应用程序冲突:(任何帮助将不胜感激。

webView.backgroundColor = yourcolor;

你甚至可以在IB中做到这一点。

   id scrollView = [[[self yourWebView] subviews] objectAtIndex:0];
   if([scrollView respondsToSelector:@selector(setBackgroundColor:)] )
   {
      [scrollView performSelector:@selector(setBackgroundColor:) 
                       withObject:[UIColor groupTableViewBackgroundColor]];
   }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM