繁体   English   中英

从文档目录在webview中以html显示图像

[英]display image in html in webview from document directory

我想以html格式显示图像,该图像正从App的Document目录显示在UIWebView

有人可以建议我如何做到这一点吗?

   NSString *path = [[NSBundle mainBundle] bundlePath];
   NSURL *baseURL = [NSURL fileURLWithPath:path];
   [webView loadHTMLString:htmlString baseURL:baseURL];

然后,您可以像这样引用您的图片:

   <img src="myimage.png">

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM