如何在iOS中以编程方式制作屏幕截图?

时间:2010-12-30 23:03:00

标签: ios screenshot

如何在iOS中以编程方式制作屏幕截图?

1 个答案:

答案 0 :(得分:3)

玩得开心

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