iOS的UIWebView看起来更像Safari并留在应用程序中 [英] iOS UIWebView of RSS to look more like Safari and stay inside app

查看:121
本文介绍了iOS的UIWebView看起来更像Safari并留在应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个RSS阅读器应用程序......但我注意到UIWebView呈现的RSS提要与Safari有很大不同。



这是RSS提要.. 。


Im creating an RSS reader app...but I have noticed that UIWebView renders the RSS feed very differently than Safari does.

This is the RSS feed... http://www.sigmapi2.org/index.php?option=com_ninjarsssyndicator&feed_id=2&format=raw

This is what I want my UIWebView to look like...this is a screenshot from iOS' Mobile Safari

NSURL *url = [NSURL URLWithString:@"http://www.sigmapi2.org/index.php?option=com_ninjarsssyndicator&feed_id=1&format=raw"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView1 loadRequest:request];}

produces a blank page in the UIWebView

And this code below...(Address taken from mobile safari when it loaded the RSS feed like I wanted it to)...

    NSURL *url = [NSURL URLWithString:@"http://reader.mac.com/mobile/v1/www.sigmapi2.org/index.php?option=com_ninjarsssyndicator&feed_id=1&format=raw"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView1 loadRequest:request];}

shows this...

any help would greatly be appreciated.

解决方案

You need to create an XML Parser. The UIWebView does not have the same capabilities as Safari. The best XML parser I found is here: https://github.com/mwaterfall/MWFeedParser

这篇关于iOS的UIWebView看起来更像Safari并留在应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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