How to take screenshot for the entire screen no matter which app is at front most in iOS 7(Jailbroken)

后端 未结 4 801
逝去的感伤
逝去的感伤 2021-02-01 23:55

Before iOS7 I use UIGetScreenImage() function to take the screenshot easily, but in iOS7, it becomes deprecated, now are there any good methods to archive this?Than

4条回答
  •  醉话见心
    2021-02-02 00:37

    UIGraphicsBeginImageContext(self.view.bounds.size);
    [self.view renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    

    This code can help you in getting a screenshot of the self.view which is whole of the screen of the iPhone no matter which app is in front.If you have used any layers in your view then the layers will not be included in the screenshot and for that you have to use self.view.layer.

提交回复
热议问题