本文介绍了捕获UIView的图像(renderInContext无法正常工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用 renderInContex 捕获 UIView 的图片,但它并不完全捕获子视图。 (例如,它不捕获 UITextView 中的单词,它不捕获 UIButton 所有。)

I am trying to capture an image of a UIView with renderInContex, but it does not fully capture all of the subviews. (For example, it doesn't capture the words in a UITextView, and it doesn't capture a UIButton at all.)

我可以使用什么?

编辑:
问题实际上是 t renderInContext ,而是我的实现。请参阅我的新问题:

The problem actually isn't renderInContext, but instead is my implementation. See my new question: Detecting change in UIView and its subviews

推荐答案

这听起来像 renderInContext 可能工作,如果你先调整图形上下文。请尝试此操作(如果您尚未这样做):

It sounds like renderInContext might work if you adjust the graphics context first. Try this if you haven't already done so: http://stackoverflow.com/a/3869804

这篇关于捕获UIView的图像(renderInContext无法正常工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 18:20