Objective-c:如何显示html<img>在没有 UIWebView 的 iOS 中标记为图像 [英] Objective-c: How to display html <img> tags as images in iOS without UIWebView

查看:59
本文介绍了Objective-c:如何显示html<img>在没有 UIWebView 的 iOS 中标记为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为新闻网站开发 iOS 应用程序,该应用程序从 url 获取其 JSON 数据,数据是 HTML,有时嵌入图像如下:

I'm developing an iOS application for a news website, the application gets its JSON data from a url, the data is an HTML and sometimes has images embedded in them like this:

<div class="row ">some text here then <div class="col-xs-12 ">
<div class="col-sm-5 col-xs-12 pull-right">
<img src="image_url" /></div></div>

到目前为止,我只知道如何获取文本(删除所有 html 标签),但我不知道如何显示嵌入在该字符串中的图像.

By far i know how to get only text (remove all html tags) but i don't know how to display the images that are embedded in that string.

有人知道怎么做吗?

注意我研究了很多,但没有找到解决方案.

Note i researched a lot and didn't find a solution for this.

提前致谢.

推荐答案

Beside try

Beside try

self.imageview1 = [UIImage  dataWithContentsOfURL@"http://www.fnordware.com/superpng/pnggrad16rgb.png"];

这篇关于Objective-c:如何显示html&amp;lt;img&gt;在没有 UIWebView 的 iOS 中标记为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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