- (void) Screener
{
UIGraphicsBeginImageContextWithOptions(self.view.frame.size, NO, 0.0);
//截屏带导航栏
[self.navigationController.view.layer renderInContext:UIGraphicsGetCurrentContext()];
//截屏不带导航栏
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
//image为截图 , 可以用来分享
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//保存到手机相册
UIImageWriteToSavedPhotosAlbum(image, nil, nil,nil);
}
网友评论