iOS HTMLViewer URL to Local Files

I have a view with an HTMLViewer on it and I’d like to load it with html content from a file in Resources. What would be the URL?

  • I tried “file:///Resources/about.htm”, but it didn’t work. :frowning: I verified that the build settings copied the about.htm file to Resources.
  • I also tried a data url, “data:text/html,Hey” with no success.

From my own app :

dim f as FolderItem = SpecialFolder.GetResource("index.html") me.LoadURL(f.Path)

You do not need a build setting to place files in the bundle, which by the way is flat, and does not have a directory structure as it does in Mac OS. Just drag the file in the project. In mine, I have a folder called html where I place all the files needed by my local site like images, other pages, etc. just for the navigator. In the end, all that will be copied flat into the bundle.

Unless you need a subfolder, of course.

Thank you Michel! I had to make one change to get it to load:

me.LoadURL( f.URLPath )

Just a somewhat related note:

In iOS the extension must be .html. If it’s .txt, you’ll see the html not formatted.

-Bob