0
我正在开发一个iOS应用程序,用户可以在其中添加尽可能多的文本和图像(就像在iPhone textview上键入和添加表情符号)到UITextView
。快照覆盖滚动项目
有什么办法让快照覆盖滚动的项目。我需要将用户添加到UITextView
的任何内容发布到他/她的Facebook墙上。目前,快照仅捕获屏幕上可见的内容。我正在使用Swift。
验证码:
UIGraphicsBeginImageContextWithOptions(message.contentSize, false, 0);
message.layer.renderInContext(UIGraphicsGetCurrentContext());
let img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
谢谢@Zev艾森伯格,我这样做了,但我意识到图像大小是内容的大小,但滚动的项目丢失了。下面是代码 UIGraphicsBeginImageContextWithOptions(message.contentSize,false,0); message.layer.renderInContext(UIGraphicsGetCurrentContext()),afterScreenUpdates:true); let img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); – 2015-02-07 05:51:02
对不起格式。我试图弄清楚它是如何在这里工作的。 – 2015-02-07 05:53:45
最好的办法是编辑你的原始文章并在那里添加代码。 – 2015-02-07 05:55:44