[英]How can I get a LIVE screenshot programmatically, when my App is running?
I just want to share a screen shoot of an UIView vie email, FB or what ever users want! 我只想分享UIView vie电子邮件,FB或任何用户想要的屏幕截图! The below code only takes a original of UIView with no inputed texts nor changed images
下面的代码仅采用UIView的原始版本,没有输入文本,也没有更改图像
CGRect rect = [mainView bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[mainView.layer renderInContext:context];
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
您应该能够使用此答案中的一种解决方案,具体取决于它是否是视网膜设备。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.