methus
methus

Reputation: 83

Html Tags in Xamarin App

Is there a way to show HTML Content (Text formatted with HTML Tags) in a Xamarin.Forms App?

If yes, are there Html Tags that are not allowed?

The content comes from a wysiwyg-editor in the web backend.

Upvotes: 0

Views: 177

Answers (1)

Paul Kertscher
Paul Kertscher

Reputation: 9703

You can use a WebView to display HTML. The documentation says

WebView supports various content sources, including embedded HTML, web pages, and HTML strings.

You could - for example - bind the content to a property

<WebView Content="{Binding HtmlContent}" />

when the BindingContext of the webview or any parent view is set accordingly.

e.g. in your viewmodel (if you are familiar with MVVM)

void LoadContent()
{
    var htmlContent = LoadContentFromServer();
    HtmlContent = htmlContent;
}

AFAIK there are no illegal HTML tags.

Upvotes: 1

Related Questions