#WebView加载的本地html

单纯的Mark一下,以供入坑的小伙伴脱坑

  NSString *jsFilePath = [[NSBundle mainBundel] pathForResource:@"XXX"ofType:@"js"];
  NSString *jsStr = [[NSString alloc]initWithContentsOfFile:jsFilePath encoding:NSUTF8StringEncoding error:nil]
  UIWebView *webView = [[UIWebView alloc]init];
  [webView stringByEvaluatingJavaScriptFromString:jsStr];
  [xxx addSubview:webView];

你可能感兴趣的:(#WebView加载的本地html)