[英]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.