我有一种情况需要显示带有图像的描述文本。 我的示例描述如下:
Test Article with Image and LinksTest Article with Image and Links<img alt="" src="http://stgen.eenaduindia.com/2015/Nov/2BF7AA1A-8036-4139-81FC-B9694D157F11_L_styvpf.gif" height="252" width="400" /><a href="http://eenaduindia.com">eenaduindia.com</a><a href="http://google.co.in">google.com</a>
我先有文字,然后是图像,然后是文字和图像。我如何在不使用 webview 的情况下本地显示此内容。请提供任何建议或现成的源代码来实现和呈现上述文本。
更新: 我们可以异步加载到 textview 吗
最佳答案
您可以为此编写 HTML 代码并在 UITextView 中显示。
NSString *htmlString = @"<html> ... </html>";
[textViewObject setValue:htmlString forKey:@"contentToHTMLString"];
关于html - 如何在 ios 中显示文本和 html 图像链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34036254/