Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我试图上传网页视图上的html页面,但图像没有加载_Ios_Uiwebview - Fatal编程技术网

Ios 我试图上传网页视图上的html页面,但图像没有加载

Ios 我试图上传网页视图上的html页面,但图像没有加载,ios,uiwebview,Ios,Uiwebview,我认为如果你的html文件或字符串有图像的url,那么它会自动加载,你就不用担心了。查看html文件,确保正确获取html字符串中的图像url。如果加载本地图像,请尝试此操作注意:上载往往意味着发送到服务器加载HTMLSTRING:将文件从服务器加载到设备。你需要更新这个问题。还有,图像在哪里?引用图像的html是什么? NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"myfile" ofType:@"html"]; N

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

如果加载本地图像,请尝试此操作注意:上载往往意味着发送到服务器<代码>加载HTMLSTRING:将文件从服务器加载到设备。你需要更新这个问题。还有,图像在哪里?引用图像的html是什么?
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];