HTML格式的数据显示在UITextView中 [英] HTML format data display in UITextView

查看:110
本文介绍了HTML格式的数据显示在UITextView中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的演示应用程序中,我尝试发送一个请求到我的测试WebService,

,它会发送给我一个JSON格式的数据。而关键是字符串,

那么这个值就是HTML格式的数据。我想用UITextView来显示内容。



但结果如下:





我希望内容显示给我,就像HTML网页一样,



但我没有知道如何处理HTML数据。



请帮助我,而且我不知道如何编写代码,



所以没有代码显示给你。我很抱歉。



预先感谢您。

解决方案

而不是UITextView,使用UIWebView:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html


In my demo application, I try to send a request to my test WebService,

and it will send me a JSON format data back.And the key is a string ,

then the value is HTML format data.I want to use the UITextView to show the content.

But the result is like this:

I want the content show to me is just like the HTML webpage,

but I dont know how to do with the HTML data.

Please help me with this, and I dont know how to write the code,

so there is no code to show to you. I am sorry about it.

Thank you in advance.

解决方案

Instead of a UITextView, use a UIWebView: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

这篇关于HTML格式的数据显示在UITextView中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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