我正在尝试删除加载并显示.pdf文件的UIWebView周围的阴影。我试图实施2010年至2013年间发布的解决方案但没有成功。我试过的解决方案包括:
self.contentWebView.layer.shadowOpacity = 0.0;
for (UIView* view in self.contentWebView.subviews)
{
view.layer.shadowOpacity = 0.0;
}
for (UIView* shadowView in [self.contentWebView.scrollView subviews])
{
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:YES];
}
}
谢谢。
答案 0 :(得分:1)
可能duplicate of this?很多解决方案,但最近的解决方案是:
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDiskImageCacheEnabled"];
[[NSUserDefaults standardUserDefaults] synchronize];
获得更多选票的老年人是:
-(void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
// Assuming self.webView is our UIWebView
// We go though all sub views of the UIWebView and set their backgroundColor to white
UIView *v = self.webView;
while (v) {
v.backgroundColor = [UIColor whiteColor];
v = [v.subviews firstObject];
}
}