开发者

Is it possible to cache web pages with a UIWebView?

开发者 https://www.devze.com 2022-12-15 09:12 出处:网络
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?

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!


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消