简体   繁体   English

如果UIView在窗口范围之外,则来自UIView的UIImage

[英]UIImage from UIView if UIView is outside window bounds

I have UIScrollView with many UIView views added to the content. 我有UIScrollView,其中许多UIView视图已添加到内容中。 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. 我想将UIView及其子视图转换为UIImage,并且如果UIView当前在设备屏幕上可见,我知道该怎么做。 Is it possible to convert UIView (subview in UIScrollView) into UIImage if UIView is not in UIScrollView visible rect? 如果UIView不在UIScrollView中,是否可以将UIView(UIScrollView中的子视图)转换为UIImage?

Could you just iterate over all subviews taking a screenshot of each UIView inside the UIScrollView ? 您是否可以对所有子视图进行迭代,为UIScrollView中的每个UIView截屏?

The following class may help with taking screenshots: http://ioscodesnippet.com/2011/08/25/rendering-any-uiviews-into-uiimage-in-one-line/ 以下课程可能有助于截图: http : //ioscodesnippet.com/2011/08/25/rendering-any-uiviews-into-uiimage-in-one-line/

Hope you find a solution. 希望您找到解决方案。

Thanks, Michael 谢谢迈克尔

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM