UIWebView去除阴影

- (void)viewDidLoad

{

    [superviewDidLoad];

   // 可以使用下述代码去除阴影,并将背景设为白色

if ([[webView subviews] count] > 0) {
  // hide the shadows
  for (UIView* shadowView in [[[webView subviews] objectAtIndex:0] subviews]) {
    [shadowView setHidden:YES];
  }
  // show the content
  [[[[[webView subviews] objectAtIndex:0] subviews] lastObject] setHidden:NO];
}
webView.backgroundColor = [UIColor whiteColor];


}


以下亲测试过可以,,

打开m文件,在

- (void)viewDidLoad

{

    [superviewDidLoad];


for (UIView *subView in [webView subviews]) {

        if ([subView isKindOfClass:[UIScrollView class]]) {

            for (UIView *shadowView in [subView subviews]) {

                if ([shadowView isKindOfClass:[UIImageView class]]) {

                    shadowView.hidden = YES;

                }

            }

        }

    } 

}


你可能感兴趣的:(IOS学习,objective-c,uiwebview)