i'm trying to take the snapshot of the all content of a UIScrollView, i have found some code here on SO, and this code below working on a half, because the snapshot if of the all uiscrollview, but the background is black, this is the code:
UIImage* image = nil;
UIGraphicsBeginImageContextWithOptions(_scrollView.contentSize,YES,0.0f);
{
CGPoint savedContentOffset = _scrollView.contentOffset;
CGRect savedFrame = _scrollView.frame;
_scrollView.contentOffset = CGPointZero;
_scrollView.frame = CGRectMake(0, 0, _scrollView.contentSize.width, _scrollView.contentSize.height);
[_scrollView.layer renderInContext: UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
_scrollView.contentOffset = savedContentOffset;
_scrollView.frame = savedFrame;
}
UIGraphicsEndImageContext();
how i can have also the background in the snapshot?