Is it possible to cache web pages with a UIWebView?

Deadly 提交于 2019-12-11 16:58:54

问题


I have an app that contains a UIWebView. I would like the user to be able to view webpages they've previously navigated to when off line. How should I go about making this work?

Thanks!


回答1:


You're going to have to download and cache all the content for each page manually, then recreate them as local pages. There's nothing like Mac OS's .webarchive format on iPhone to save web content.




回答2:


This is a similar question, but the intent was slightly different.

This answer provides detail on loading and caching the text content of a page, but you will still need to grab the other resources of the page (images, etc.) and store them locally like Ben describes.



来源:https://stackoverflow.com/questions/1987174/is-it-possible-to-cache-web-pages-with-a-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!