0
我正在使用下面的代码将文本文件内容加载到WebView中,但每次调用该方法时,内容都需要一些时间加载。任何关于缓存策略的想法,我可以在这种情况下使用它来加快速度?如何让WebView内容加载速度更快?
- (void)displayContent
{
@try {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"about-us" ofType:@"txt"];
[web_view loadHTMLString:[NSString stringWithContentOfFile:filePath encoding:NSUTF8StringEncoding error:nil] baseURL:nil];
} @catch(NSException e) {
NSLog(@"%@",e);
}
}
THX帮助,
斯特凡