I have a hidden UIView that I need to take a full screenshot of. I don't want to .hidden = NO * take screenshot * .hidden = YES. The reason is because that causes an inverted looking screenshot sometimes.
+ (UIImage *) imageWithView:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
This is my code, it does nothing if the UIView is hidden.
Take a snapshot of a hidden UIView -- Doesn't work
I've googled around and haven't found an answer. Please respond with code in Objective-C.