要求用到UITableViewCell导入到一个图片,PNG或者其他格式,实现使用MFMailComposerViewController通过Email传递。请高手帮忙。
3条回答
- lanhailvcao 2012-12-04 03:15关注
调用
UIImage *image = [cell screenshot];
- (UIImage *)screenshot { return [self screenshotForRect:self.bounds]; } - (UIImage *)screenshotForRect:(CGRect) rect { UIGraphicsBeginImageContext(rect.size); [[UIColor clearColor] setFill]; [[UIBezierPath bezierPathWithRect:rect] fill]; CGContextRef ctx = UIGraphicsGetCurrentContext(); [self.layer renderInContext:ctx]; UIImage *anImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return anImage; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报