UIActivityViewController与HTML [英] UIActivityViewController with HTML

查看:79
本文介绍了UIActivityViewController与HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将包含HTML内容的字符串作为数组元素传递给 UIActivityViewController initWithActivityItems 方法时,它不会在选定的'share'控制器中将其显示为HTML,但而是提供HTML源代码(即标记而不是解释它)。



虽然我可以理解为什么它会对不支持html内容的共享目标执行此操作,它不会将它解释为电子邮件,也不会这样做(以前这可以通过将> 属性设置为 YES

我应该浪费时间创建一个 MFMailComposeController )。

UIActivityItemProvider 会根据'activity type'返回自定义内容,或者真的没有办法让 UIActivityViewController 提供的邮件控制器来解释内容为HTML?

解决方案

您期待什么样的活动? upport?活动类型取决于服务,而且它们很漂亮明确定义。例如,服务无法知道字符串是纯文本还是标记文本 - 您可能需要粘贴HTML代码。



您总能以老式的方式做事,并将纯文本和HTML复制到粘贴板,或者直接调用邮件编辑器,或者任何你想要完成的任务。


When I pass a string containing HTML content as an array element to the UIActivityViewController initWithActivityItems method it doesn't present it as HTML in the selected 'share' controller, but instead presents the HTML source (i.e. the markup rather than interpreting it).

And while I can understand why it would do this for share targets that don't support html content, it won't interpret it for things like email either, which do (previously this would be done by setting the isHTML property to YES on the MFMailComposeController).

Should I waste my time creating a UIActivityItemProvider that returns custom content based on the 'activity type' or is there really no way to get the mail controller presented by the UIActivityViewController to interpret the content as HTML?

解决方案

What activities are you looking to support? Activity types are dependent on the service, and they're pretty clearly defined. There's no way for services to know that a string is a plain text or marked-up text, for example--you might want to paste HTML code on purpose.

You can always do things the old-fashioned way and copy plain text and HTML to the pasteboard, or call the mail composer directly, or whatever you're trying to accomplish.

这篇关于UIActivityViewController与HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆