Developer Docs - Mobile Docs - HTML

App Icon Styling

Inherits from ContentView

This view enables HTML rendering on the page, though HTML support is limited in mobile applications and may impact performance. It's best to use HTML sparingly; you don’t need to avoid it altogether, but rendering numerous paragraphs may reduce responsiveness.

Since you’re defining HTML in an XML file, using Text="{{ Item.Html }}" won’t work directly. You’ll need to escape the HTML text or apply the CDATA approach shown below. Alternatively, you can use the XamlWrap filter in Lava as well.


    This is some sample text.

This is a second paragraph.

]]>

When enabling FollowHyperlinks, the text will be tappable on iOS, however there is a bug in Xamarin Forms (shell v5) that prevents the text from being styled with an underline.

Did you know that formatted content can also be shown with Markdown?

Markdown

Supported Tags

A limited subset of HTML tags is supported. Any non-supported tags will be rendered as their plain text contents (meaning, the HTML tags are stripped).

Styling

You can perform limited styling of rendered HTML content. This only operates at a block level and only with internal classes that are applied. This means you cannot specify your own CSS class in the HTML, nor can you target a specific inline element via CSS (such as a span tag).

Note that bold and italic styles aren't natively supported for custom fonts added to the shell during the App Factory publishing process. While other font weights can be included, they must be uploaded and referenced as separate font family files. If you need to apply bold or italic formatting, the default font families on iOS and Android provide this support.

The best way to style these elements would be with a custom StyleClass applied like so:

...

Then in the custom CSS, target classes you want to change:

.html-content .paragraph { margin-bottom: 0; }

In general, styling should be kept to basics, such as margins and possibly colors or font selections. The HTML control elements may change in future versions, so avoid applying styles to specific elements unless you're prepared for potential breakage down the line.