ios 截屏

把当前屏幕作为获取成为图片

- (UIImage *)rn_screenshot {
    UIGraphicsBeginImageContext(self.bounds.size);
    [self.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    NSData *imageData = UIImageJPEGRepresentation(image, 0.75);
    image = [UIImage imageWithData:imageData];
    return image;
}

 

ios 截屏,布布扣,bubuko.com

ios 截屏

上一篇:常用的移动前端webapp交互细节


下一篇:Android学习6—单元测试的使用