ios---加载本地html文件

    WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.frame];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"ios_test" ofType:@"html"];
    NSString *html = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
    [wevView loadHTMLString:html baseURL:nil];
    [self.view addSubview:webView];

你可能感兴趣的:(ios---加载本地html文件)