当我们加载一个本地HTML文件的时候,一个文件夹里还有css , js ,image文件,所以单独加载一个html文件会没有图片,只有文字,解决方案如下:
代码加载部分
NSString *pathStr = [[NSBundle mainBundle] pathForResource:@"go-live" ofType:@"html" inDirectory:@"record"];//注意要加载文件夹的名字
[self.web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:pathStr]]];
这样就大功告成了