question

imaddiraa-4704 avatar image
0 Votes"
imaddiraa-4704 asked KyleWang-MSFT edited

xamarin forms label html texttype with linebreakmode tailtrunctaed unexcpected behavior

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

dotnet-xamarin
capture12.png (75.8 KiB)
capture24.png (57.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleWang-MSFT avatar image
0 Votes"
KyleWang-MSFT answered KyleWang-MSFT edited

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.