【发布时间】:2015-03-01 04:08:42
【问题描述】:
下面的代码捕获了 web 视图的屏幕而不是整个页面:
func screenShotMethod() {
//Create the UIImage
UIGraphicsBeginImageContext(view.frame.size)
view.layer.renderInContext(UIGraphicsGetCurrentContext())
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
//Save it to the camera roll
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
}
如何在 UIWebView 中捕获整个 HTML 页面(包括溢出)?
【问题讨论】:
-
让 webview 和 context 的高度都变大。
-
我是新手。请更具体。