如何在Swift中拍摄全屏截图?
我找到了以下代码:
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)
}
要使所有其他元素(如导航栏)进入屏幕截图,我需要做什么?
幕布斯6054654
杨__羊羊
红颜莎娜
慕姐8265434