How do I take a 1:1 screenshot of UIScrollView visible area? The content may be larger or smaller than UIScrollView bounds as well as half-hidden (I\'ve implemented custom scrol
@Abduliam Rehmanius's answer has poor performance, since if the UIScrollView
contains a large content area, we will draw that entire content area (even outside the visible bounds).
@Concuror's answer has the issue that it will also draw anything that is on top of the UIScrollView
.
My solution was to put the UIScrollView
inside a UIView
called containerView
with the same bounds and then render containerView
:
containerView.renderInContext(context)