I am trying to take a screenshot/snapshot of a UIView. I am able to get the a screenshot with the code below of the current visible view - but i am after the whole view.
The view is a scrollview so there is content below that isnt visible that i would like to be included
How do i extend this code to take into account the view that isnt visible?
UIGraphicsBeginImageContext(activityView.frame.size);
[self.activityView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *fullScreenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(fullScreenshot, nil, nil, nil);
There is a new method introduced from iOS 7 for a class
UIView
.You can use this method to take screenshots of your current view.
try this:
try this way may be helped you
I have found the problem. The scrollview was a subview of the view i was taking a snapshot of. To fix it i drilled down to the correct view.