在iPhone上打开.webarchive? [英] Open a .webarchive on the iphone?
问题描述
有人知道你是否可以在iPhone上以编程方式打开.webarchive? .webarchive是Safari打包网页的方式,它将相关资源打包成一个文件。
Does anyone know if you can programmatically open a .webarchive on the iPhone? A .webarchive is Safari's way of packaging up a webpage and it's associated resources into a single file.
我尝试创建一个并浏览到移动版Safari中的链接,但它不起作用....
I tried creating one and browsing to a link to one in mobile safari, but it didn't work....
注意:我有点希望没有第三方应用程序可以完成,因为这是一个很好的方式打包WebApp以便在iphone上使用而无需第三方工具。
Note: I was kind of hoping this could be done without a 3rd party app, as it'd be a nice way to package up a WebApp for use on the iphone without needing a third party tool.
推荐答案
iOS上支持webarchive。只需在UIWebView上加载它。它只是有效!
webarchive is supported on iOS. Just load it on UIWebView. It just works!
用于在您的捆绑包上加载webarchive,只需执行
for loading a webarchive on your bundle, just do
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"myFile"
withExtension:@"webarchive"];
[webView loadRequest:[NSURLRequest requestWithURL:fileURL]];
webview是你的UIWebview
webview is your UIWebview
这篇关于在iPhone上打开.webarchive?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!