xamarinuwprichtextblock

Xamarin.UWP RichTextBlock Hanging Indentation


I used custom renderer to display a Label as RichTextBlock. Using Paragraph, there is a TextIndentProperty to indent first line. However, I also need "Hanging Indentation" found in RichEditBox or SetIndent found in ITextParagraphFormat.

Is there a way to implemnent "Hanging Indentation" in RichTextBlock?


Solution

  • I have found the solution to this question. Use left-padding to shift the entire paragraph in (say 10px) Then, use text-indent with negative value to shift the first line of the paragraph out again (say -10px). With this method, a hanging indentation can be achieved.