[英]display image in html in webview from document directory
I would like to display an image in html which is being displayed on a UIWebView
from the App's Document directory. 我想以html格式显示图像,该图像正从App的Document目录显示在
UIWebView
。
Can someone suggest me how to accomplish that? 有人可以建议我如何做到这一点吗?
NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
[webView loadHTMLString:htmlString baseURL:baseURL];
You can then refer to your images like this: 然后,您可以像这样引用您的图片:
<img src="myimage.png">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.