【发布时间】:2011-03-11 06:53:57
【问题描述】:
我想以 html 格式显示图像,该图像正在应用程序的 Document 目录中的 UIWebView 上显示。
有人可以建议我如何做到这一点吗?
【问题讨论】:
标签: iphone ios uiwebview uikit
我想以 html 格式显示图像,该图像正在应用程序的 Document 目录中的 UIWebView 上显示。
有人可以建议我如何做到这一点吗?
【问题讨论】:
标签: iphone ios uiwebview uikit
NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
[webView loadHTMLString:htmlString baseURL:baseURL];
然后您可以像这样引用您的图像:
<img src="myimage.png">
【讨论】: