UIWebView是可以用来加载本地资源的,具体使用方法如下: NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; [webView loadHTMLString:htmlString baseURL:baseURL]; 这里path是所存放的资源的根目录,htmlString就是我们所要加载的html页面的内容,baseURL是页面中所用到的链接的根目录的url 如:htmlString=@"<html><body><image src='a.jpg'></body></html>"; |
|
来自: xue_dong5437 > 《ios》