Mobile HTML Viewer
From Xojo Documentation
The HTML Viewer control displays rendered HTML.
Refer to MobileHTMLViewer in the Language Reference for the full list of events, properties and methods.
Methods
- Displays the web page at the specified URL.
Usage
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 String = "<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)
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
MobileHTMLViewer class; UserGuide:iOS User Interface Controls topic