Reputation: 2483
I have an app that downloads HTML files and stores them into the /Documents folder, and then they are shown in a UIWebView via the loadRequest:
method. All pretty straight-forward, except the scrolling of the HTML page is EXTREMELY slow and choppy. I am scratching my head as to specifically what is causing this, as well as how to resolve (if there is a way to resolve).
These HTML files are produced with pdf2htmlEX, so all of the images are embedded in the code itself (the HTML file is stand-alone with no need for external images). The HTML files range from around 3-7mb in size. I'm guessing this is part of the reason why the scrolling is slow, but even when we reduced one by half, as a test, the scrolling was still slow and didn't seem to help much, if any at all.
I'd think that there must be some solution, since they are simply reading from the filesystem rather than an online source. I've searched similar topics with no luck on finding a solution, although I've thought about implementing the ASIWebPageRequest library to see if that helps at all.
If needed, below is a link to an example of an HTML file that the app is trying to show. Any thoughts, or if I need to provide more info, no problem. Thanks in advance!
https://www.dropbox.com/s/itvqjrq9pao0ylu/1218_09_11.html
Upvotes: 1
Views: 1281
Reputation: 933
I work with Vincent, and he and I rattled out the solution. It boiled down to:
<style type='text/css'>
body {
-webkit-overflow-scrolling: touch;
}
</style>
The scrolling cleared up quite a bit ... but now we have slight rendering delays, but I think given the size of the files we're producing, the iPad is keeping up pretty well.
We're still going to research that side of it, though.
Upvotes: 4
Reputation: 453
I guess it really is that the file is too big and complicated, I've uploaded your file onto my server http://my-realm.com/1218_09_11.html and my phone won't even open this address - shows cfnetwork error 303.
if you have the original PDF files, why not just present these PDF files to the user? In my experience iOS handles large PDF files a lot better than large HTML files, I have an app that shows a couple of PDF files around 10mb one by one and has no problem at all.
Upvotes: 0