I have a very strange situation ... I am trying to grab content from a scroll (which contentSizeexceeds the borders of the screen three times) by calling drawViewHierarchyInRect: afterScreenUpdates:, as shown below:
+ (UIImage *) imageFromScrollView: (UIScrollView *) scrollView {
UIGraphicsBeginImageContext(size);
[view drawViewHierarchyInRect: CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height)
afterScreenUpdates: YES];
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
He works for: device iPhone, iPhone and iPad Simulator, but it does not work on the iPad device . Have you ever encountered a similar problem? I would be grateful for any help!
source
share