ios html.fromhtml,ios - How to show HTML text from API on the iPhone? - Stack Overflow

The best example to explain my situation is to use a blog post. Let's say I have a UITableView loaded with title's of blog posts that I got from an API. When I click on a row I want to show the detailed blog post.

When doing that, the API is handing back several fields, including the "post body" (which is HTML text). My question is, what should I use to display it so it shows up as formatted HTML? Should I use a UIWebView for that? I'm not sure if you use a UIWebView when you are literally viewing a web page (like initialize it with a URL or something) or if you can hand it an HTML string and it will format it properly.

There are several other fields that will be showing on this page, such as title, category, author, etc. I'm just using UILabels for those, so no problems there. But I don't know what to do with the HTML chunk. I'm doing all of this programmatically, btw.

If you can't tell, I'm relatively new to iOS development, only about 2-3 weeks in, with NO obj-c background. So if a UIWebView is the right approach, I'd also appreciate any "gotcha!" notes, if there are any.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值