2

i'm trying to create a snapshot of a complete uiscrollview, all the content size, i have searched a lot, and i have found something here on SO, like this:

Getting a screenshot of a UIScrollView, including offscreen parts

i have tried it, but there is a problem, because in the screenshot some element for example some UIImageView are enlarged or stretch, or in a different position, i can't understand why, anyone can help me to create this snapshot?

Community
  • 1
  • 1
Piero
  • 9,173
  • 18
  • 90
  • 160

1 Answers1

0

I'm not sure, but I think that UIScrollView elements are created and updated when they appear to the user. If so, probably their frames are not ready to be displayed when not on the shown "window".

Try to rasterize the content of your UIScrollView.

yourLayer.shouldRasterize = YES;

This way eveything should be updated at one time.

Giuseppe Garassino
  • 2,272
  • 1
  • 27
  • 47