iOS UIWebView 的 RSS 看起来更像 Safari 并留在应用程序中
我正在创建一个 RSS 阅读器应用程序...但我注意到 UIWebView 呈现 RSS 提要的方式与 Safari 非常不同。
这是 RSS 提要... http://www.sigmapi2.org/index.html php?option=com_ninjarsssyndicator&feed_id=2&format=raw
这就是我希望 UIWebView 的外观就像...这是 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];}
在 UIWebView 中生成一个空白页面
下面的代码...(地址取自 mobile safari像我想要的那样加载了 RSS 提要)...
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];}
显示了这个...
任何帮助将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要创建一个 XML 解析器。 UIWebView 不具备与 Safari 相同的功能。我发现的最好的 XML 解析器在这里: https://github.com/mwaterfall/MWFeedParser
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
您需要实现一个必须与 baseurl 不同的 url。
You need to implement a url that must be different than the baseurl.