UIImage from UIView if UIView is outside window bo

2019-09-17 16:54发布

I have UIScrollView with many UIView views added to the content. I would like to convert UIView and its subviews to UIImage and I know how to do it if the UIView is currently visible on the device screen. Is it possible to convert UIView (subview in UIScrollView) into UIImage if UIView is not in UIScrollView visible rect?

1条回答
劳资没心,怎么记你
2楼-- · 2019-09-17 17:38

Could you just iterate over all subviews taking a screenshot of each UIView inside the UIScrollView ?

The following class may help with taking screenshots: http://ioscodesnippet.com/2011/08/25/rendering-any-uiviews-into-uiimage-in-one-line/

Hope you find a solution.

Thanks, Michael

查看更多
登录 后发表回答