我使用此方法将webview屏幕截图保存到文件中:
UIGraphicsBeginImageContext(webview.bounds.size);
[webview.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[imageData writeToFile:imagePath atomically:YES];
但有时它的灰色区域。我如何删除那个灰色区域?