闲话少说,直接代码:


@implementation UIWebView (ClearBackground)


//去掉水平滚动条和黑色背景

- (void)clearTheBackgroundColorAndHorizontalScrollIndicator

{

for (UIScrollView *view in self.subviews) {

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

[view setShowsHorizontalScrollIndicator:NO];

view.bounces = NO;

}

}

[self setScalesPageToFit:YES];

self.backgroundColor = [UIColor clearColor];

[self setOpaque:NO];

}


@end