xamarin forms label html texttype with linebreakmode tailtrunctaed unexcpected behavior

imad diraa 41 Reputation points
2021-07-21T14:01:00.517+00:00

HELLO EVERYONE, when i use the LineBreakMode="TailTruncation" the label works fine and cut the end adding ellipsize(...) like in the image

116764-capture12.png

    <StackLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">  
        <Label TextType="Text" LineBreakMode="TailTruncation" MaxLines="2" FontSize="38">  
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.</Label>  
    </StackLayout>  

but when i change the texttype to html the behavior of line break mode change like the image 2

116707-capture24.png

my question is: how to prevent this behavior while using html texttype

    <StackLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">  
        <Label TextType="Html" LineBreakMode="TailTruncation" MaxLines="2" FontSize="38">  
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.</Label>  
    </StackLayout>  
  

i search in the internet and dosen't find anything, the only solution i have is not to use html which is required for the app im developing

thanks

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,347 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kyle Wang 5,531 Reputation points Microsoft Vendor
    2021-07-22T01:23:25.887+00:00

    Hi imaddiraa-4704,

    Welcome to our Microsoft Q&A platform!

    It is indeed an existing issue, Html's LineBreakMode does not work properly.

    This issue has been submitted on Github: Line break mode not applying on Html Labels. And it has been added to To do list here.

    Thank you for your feedback.

    Regards,
    Kyle


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.