开发者

need to be able to email a document or a content of UIView

a noob ques开发者_运维百科tion here.

i would like to give the user a button that would prep an email with the content of a UIView attached.

is this (easily) doable ? I know how to create a basic email, but not with attachments and certainly not with a dump of an UIView content. I am guessing this would be a two step process. First get the content of the UIView into a "attachable form" (how ? #1). Then attach it. (how ? #2)

could someone please point me the right direction ?

thank you!


i think you can start by converting the UIView to an image.

UIGraphicsBeginImageContext(myView.bounds.size);
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

after that you can read that to see how to attach the image to the mail

http://howtomakeiphoneapps.com/2009/07/how-to-make-your-iphone-app-send-email-with-attachments/

good luck

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜