Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIWebView屏幕截图上的灰色框_Iphone_Ios_Uiwebview - Fatal编程技术网

Iphone UIWebView屏幕截图上的灰色框

Iphone UIWebView屏幕截图上的灰色框,iphone,ios,uiwebview,Iphone,Ios,Uiwebview,我使用以下方法将webview屏幕截图保存到文件: UIGraphicsBeginImageContext(webview.bounds.size); [webview.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [imageD

我使用以下方法将webview屏幕截图保存到文件:

UIGraphicsBeginImageContext(webview.bounds.size);     
[webview.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

[imageData writeToFile:imagePath atomically:YES]; 
但有时它有一个灰色区域。我如何去除灰色区域


整个灰色区域是否为网络视图?看起来像面向肖像的ipad大小。你把截图放在哪里?不,网络视图完全加载了(没有任何灰色),但是当我把它保存到UIImage的时候,它是灰色的appeared@nickweaver,这是我用上面的代码保存的截图文件