iOS_Vinch

#WebView加载的本地html

2017-07-04  本文已影响5人  Vinch

单纯的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];
上一篇 下一篇

猜你喜欢

热点阅读