【发布时间】:2013-01-20 01:50:05
【问题描述】:
我只想分享 UIView vie 电子邮件、FB 或任何用户想要的屏幕截图! 下面的代码只取了 UIView 的原件,没有输入文本也没有改变图像
CGRect rect = [mainView bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[mainView.layer renderInContext:context];
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
【问题讨论】:
标签: iphone ios cocoa-touch uiview