【问题标题】:display image in html in webview from document directory在文档目录中的 webview 中以 html 格式显示图像
【发布时间】:2011-03-11 06:53:57
【问题描述】:

我想以 html 格式显示图像,该图像正在应用程序的 Document 目录中的 UIWebView 上显示。

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

【问题讨论】:

标签: iphone ios uiwebview uikit


【解决方案1】:
【解决方案2】:
   NSString *path = [[NSBundle mainBundle] bundlePath];
   NSURL *baseURL = [NSURL fileURLWithPath:path];
   [webView loadHTMLString:htmlString baseURL:baseURL];

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

   <img src="myimage.png">

【讨论】:

    猜你喜欢
    • 2013-02-24
    • 1970-01-01
    • 1970-01-01
    • 2015-08-27
    • 2014-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-23
    相关资源
    最近更新 更多