I'm successfully using the WebView control to render a HTML string that I'm parsing to it... It's rendering my CSS, H1, and paragraph content perfectly.
Then, I tried to add an image tag and load in an image that is already stored locally on the phone. But it can't see to find or render the image in the WebView. How do I display locally stored images in the WebView?
Here's what I have tried:
string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
string localFilename = "project-" + ProjectId + ".png";
string localPath = "file://" + Path.Combine(documentsPath, localFilename);
string FinalHtml =
"<html><head><style>a, h1 {color:#6fb731;} h1{font-size: 1.4em;} p, body{color:#333333;}</style></head><body>" +
"<img src=\"" + localPath + "\" />" +
"<h1>" + ProjectName + "</h1>" + ProjectHtml +
"</body></html>";
ProjectsWebView.LoadData(FinalHtml, "text/html", "UTF-8");