PGSSoft / Pgs.CrossPlatform.FormattedText

Cross Platform C# Xamarin Formatted Text Label control enabling to add own tags [b][/b] or similar to HTML tags <b><b><H1></H2> to format text in any size and font

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pgs.CrossPlatform.FormattedText

Cross Platform C# Xamarin Formatted Text Label control enabling to add own tags [b][/b] or similar to HTML tags <b><b><H1></H2> to format text in any size and font

Android and iOS are currently supported

NuGet: https://www.nuget.org/packages/Pgs.CrossPlatform.FormattedText/

  • Droid: add to MainActivity.cs at the very start of OnCreate:

    iOS: add to Main.cs at the very start of Main:

// TOP OF OnCreate/Main
// first param determines whether throw exception if specific tag is lacking
FormatConfig.Init(true, '[', ']'); 
  • adjust config in FormatConfig.cs - for iOS you must keep given if-style pattern to make nesting work properly
  • use control within xaml like:
// namespace
    xmlns:ft="clr-namespace:Pgs.CrossPlatform.FormattedText;assembly=Pgs.CrossPlatform.FormattedText" 
// later in content
    <ft:FormattedLabel Text="Welcome [i]W[b]elc[/b]om[b]e[/b][/i] [b]t[i]o[/i][/b] [b][i]Xama[/i]rin[/b] [b][i]Forms[/i][/b]!"
        x:Name="formated"
        VerticalOptions="Center"
        HorizontalOptions="Center" />

About

Cross Platform C# Xamarin Formatted Text Label control enabling to add own tags [b][/b] or similar to HTML tags <b><b><H1></H2> to format text in any size and font

License:MIT License


Languages

Language:C# 90.0%Language:Pascal 10.0%