html - 如何在 ios 中显示文本和 html 图像链接

标签 html ios objective-c iphone

我有一种情况需要显示带有图像的描述文本。 我的示例描述如下:

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/

相关文章:

ios - 用户定义的运行时属性中的关键路径是什么?

iphone - 为此方法自定义 UITableViewCell 的手动布局?

ios - 获取排序数组中的 IndexPath

ios - Objective-C 延迟 iOS 6 中的方法 dispatch_get_current_queue 弃用

ios - dealloc 总是被调用吗?即使您滑动关闭应用程序?

ios - 修改 contentEdgeInset 后 UINavigationBar 下的 UITableView 滚动指示器

javascript - 在圆环图中显示多个数据信息

html - 使用 HTML 和 CSS 中的侧边栏制作一个简单的布局

html - CSS 在我的 RoR 应用程序中无法正常工作

javascript - 表单未得到验证