iOS 截屏方法
2018-06-14 14:06 更新
- //获取屏幕截屏
- - (UIImage*)getScreenShotsOfView:(UIView *)view{
- CGSize size = view.frame.size;
- UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
- CGContextRef context = UIGraphicsGetCurrentContext();
- [view.layer renderInContext:context];
- UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- return img;
- }
以上内容是否对您有帮助:
更多建议: