Multiline Truncated Label

In my application in Xamarin.Forms, I have a shortcut that I want to be multi-line, but only to a certain point. After that, it should be truncated. How can I achieve this?

I can currently install LineBreakMode on WordWrap ; this creates a multi-line label, but no truncation.

If he changed the value of LineBreakMode to TailTruncation , it is always trimmed after one line.

+5
source share
1 answer

To do this, you need an effect or rendering. For example, on iOS, you can make an effect for Label , which sets native UILabel Lines = 0 and LineBreakMode = UILineBreakMode.TailTruncation .

0
source

Source: https://habr.com/ru/post/1234786/


All Articles