我正在尝试在 Web 视图中上传 html 页面,但未加载图片

i am trying to upload html page on web view but images are not loading

NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"myfile" ofType:@"html"];
NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
NSLog(@"The html string is %@",htmlString);
[_Webview loadHTMLString:htmlString baseURL:nil];

我认为如果您的 html 文件或字符串具有图像的 url 那么它会自动加载它,您不必担心。查看您的 html 文件并确保您在 html 字符串中正确获取图像 url。