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