ios加载本地html无法加载图片问题解决

  • 将资源文件夹加入工程中,创建蓝色文件夹
ios加载本地html无法加载图片问题解决_第1张图片
Paste_Image.png
  • 获取html,展示即可

UIWebView *web = [[UIWebView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:web];
    
    NSURL *filePath = [[NSBundle mainBundle] URLForResource:@"文件目录/xxx.html" withExtension:nil];
    NSURLRequest *request = [NSURLRequest requestWithURL:filePath];
    
    [web loadRequest:request];

你可能感兴趣的:(ios加载本地html无法加载图片问题解决)