WKWebview 打开本地PDF文件
2020-05-08 本文已影响0人
仗键天涯
WKWebView* webView = [[WKWebView alloc] initWithFrame:frame];
webView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:webView];
NSURL *filePath = [NSURL fileURLWithPath:self.billFile];//注意了,本地文件不能用URLWithString,会显示失败
[webViewloadRequest:[NSURLRequest requestWithURL:filePath]];