UserGuide

iOS HTML Viewer

From Xojo Documentation

The HTML Viewer control displays rendered HTML.

Refer to iOSHTMLViewer in the Language Reference for the full list of events, properties and methods.

Methods

LoadURL

Displays the web page at the specified URL.

Usage

iOS HTML Viewer

To display a web page, specify the URL:

HTMLViewer1.LoadURL("http://www.xojo.com%22)

If you want to display your own HTML from text, you first have to save it to a file and then pass the URLPath to the file:

Var html As Text = "<html><body>Hello!</body></html>"

Var htmlFile As FolderItem = SpecialFolder.Documents.Child("hello.html")
Var output As TextOutputStream
output = TextOutputStream.Create(htmlFile, TextEncoding.UTF8)
output.WriteLine(html)
output.Close

HTMLViewer1.LoadURL(htmlFile.URLPath)

Example Projects

  • Examples/iOS/Controls/HTMLViewerExample

See Also

iOSHTMLViewer class; UserGuide:iOS UI topic