I made a document viewer using UIWebView
. The load time is short, because files are local, but the scrolling speed makes me so crazy. The scrolling performance is very poor!
I made it using this: code.
NSURLRequest* request = [NSURLRequest requestWithURL:fileURL
cachePolocy:NSURLRequestRel开发者_开发知识库oadIgnoringLocalCacheData
timeoutInterval:60.0];
[self.webView loadRequest:request];
How can I enhance the performance of UIWebView
?
Run your app under Instruments and look for where your performance bottlenecks are. The most likely cause of poor scrolling is that your CPU is maxed out, possibly by some other activity your program is performing.
Alternately, it could have trouble due to complex Javascript in the HTML or illegal HTML. Load your HTML and Javascript into Safari on the Mac and use the Developer's Web Inspector to profile it. Look in the Advanced Preferences for the option to turn on the "Develop" menu.
精彩评论