2013-11-27 66 views

回答

-1

请试试这个代码段与您的Web视图

myWebView.opaque = NO; [myWebView setBackgroundColor:[UIColor clearColor]];

+0

哦。我知道......我会试试。 –

+0

是的,它为我工作......谢谢 –

0

为了UIWebView的背景透明,你可以使用

webView.opaque = NO; 
webView.backgroundColor = [UIColor clearColor]; 

如果您也想删除的阴影对一个UIWebView创建类别:

的UIWebView + ShadowRemoval.m

#import "UIWebView+ShadowRemoval.h" 

@implementation UIWebView (ShadowRemoval) 

-(void)removeShadows 
{ 
    for(UIView *view in [self subviews]) { 
     if([view isKindOfClass:[UIScrollView class]]) { 
     for(UIView *innerView in [view subviews]) { 
      if([innerView isKindOfClass:[UIImageView class]]) { 
       innerView.hidden = YES; 
      } 
     } 
    } 
    } 
} 

@end