Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matteobortolazzo/HtmlLabelPlugin

Use this Xamarin.Forms plugin to display HTML content into a label.
https://github.com/matteobortolazzo/HtmlLabelPlugin

android forms html ios labels uwp xamarin xamarin-forms xamarin-plugin

Last synced: 29 days ago
JSON representation

Use this Xamarin.Forms plugin to display HTML content into a label.

Awesome Lists containing this project

README

        

[![Build Status](https://dev.azure.com/matteobortolazzo/HtmlLabel/_apis/build/status/matteobortolazzo.HtmlLabelPlugin?branchName=master)](https://dev.azure.com/matteobortolazzo/HtmlLabel/_build/latest?definitionId=26&branchName=master)
[![Downloads](https://img.shields.io/nuget/dt/Xam.Plugin.HtmlLabel.svg)](https://www.nuget.org/packages/Xam.Plugin.HtmlLabel/)

# HTML Label Plugin for Xamarin.Forms
Use this Xamarin.Forms plugin to display HTML content into a label.

## Setup
* Available on [NuGet](https://www.nuget.org/packages/Xam.Plugin.HtmlLabel)
* Install it in every Xamarin.Forms project.
* **iOS**: AppDelegate.cs
```cs
HtmlLabelRenderer.Initialize();
global::Xamarin.Forms.Forms.Init();
```
* **Android**: MainActivity.cs
```cs
HtmlLabelRenderer.Initialize();
global::Xamarin.Forms.Forms.Init(this, bundle);
```
* **UWP**: App.xaml.cs
```cs
var rendererAssemblies = new[] { typeof(HtmlLabelRenderer).GetTypeInfo().Assembly };
Xamarin.Forms.Forms.Init(e, rendererAssemblies);
HtmlLabelRenderer.Initialize();
```

## How it works
On iOS and Android it uses the native HTML rendering capabilities of iOS's UILabel and Android's TextView.

UWP's TextBlock cannot renders HTML so the library parses the HTML and uses Inlines to display: `, ,
, , ,

, , ,