这是一个复习UIWebView的方法
@interface
UIWebView (UIWebView_Category)
// 去掉webview的阴影,把背景设成单色
- (
void
)clearBackgroundWithColor:(UIColor*)color;
@end
@implementation
UIWebView (ZJLWebView)
- (
void
)clearBackgroundWithColor:(UIColor*)color
{
// 去掉webview的阴影
self
.backgroundColor = color;
for
(UIView* subView in [
self
subviews])
{
if
([subView isKindOfClass:[UIScrollView
class
]]) {
for
(UIView* shadowView in [subView subviews])
{
if
([shadowView isKindOfClass:[UIImageView
class
]]) {
[shadowView setHidden:
YES
];
}
}
}
}
}
在调用的时候这样调用
[helpWebView clearBackgroundWithColor:
nil
];
希望对大家有帮助。
文章转载自xcodechina 文章地址http://www.xcodechina.com/forum.php?mod=viewthread&tid=231&extra=page%3D1