我在我的应用程序中创建了库照片,我想放一个按钮,通过电子邮件分享图像。 有人可以帮我吗?
我试过这个,但这个是tex:
let firstActivityItem = "your text here"
let secondActivityItem : NSURL = NSURL(fileURLWithPath: "your link here")!
let activityViewController : UIActivityViewController = UIActivityViewController(
activityItems: [firstActivityItem, secondActivityItem], applicationActivities: nil)
activityViewController.excludedActivityTypes = [
UIActivityTypePostToWeibo,
UIActivityTypePrint,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo,
UIActivityTypePostToTencentWeibo
]
答案 0 :(得分:0)
如果您只想通过电子邮件分享,请使用 def prettify(elem):
"""
Return a pretty-printed XML string for the Element.
"""
rough_string = ET.tostring(elem, 'utf-8')
reparsed = minidom.parseString(rough_string)
return reparsed.toprettyxml(indent="\t")
。
有关如何将图像附加到this answer的信息,请参阅$?
。