0

I would like to display an image in html which is being displayed on a UIWebView from the App's Document directory.

Can someone suggest me how to accomplish that?

Till
  • 27,559
  • 13
  • 88
  • 122
pankaj
  • 7,878
  • 16
  • 69
  • 115
  • http://stackoverflow.com/questions/478665/link-to-resources-inside-webview-iphone/1382396#1382396 Here I found the answer – pankaj Jul 26 '11 at 12:52

2 Answers2

1

This can help you

Using HTML and Local Images Within UIWebView

Link to resources inside WebView - iPhone

Community
  • 1
  • 1
visakh7
  • 26,380
  • 8
  • 55
  • 69
-2
   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">
Till
  • 27,559
  • 13
  • 88
  • 122
Brijesh Vadukia
  • 922
  • 8
  • 11