Label: MaxLines and LineBreakMode #5492
Replies: 9 comments 3 replies
-
fixed in next release see this pr |
Beta Was this translation helpful? Give feedback.
-
This is still an issue, If i have a label with TailTruncation and MaxLines at 2 |
Beta Was this translation helpful? Give feedback.
-
The behavior is for backward compatibility with Xamarin.Forms. If you want a custom (and more sensible) behavior in your .NET MAUI app, you can see how to modify it in this repo. It's basically a few lines you cut-and-paste into your |
Beta Was this translation helpful? Give feedback.
-
what about iOS? |
Beta Was this translation helpful? Give feedback.
-
Did you manage to find a workaround for this, having similar issues but looking for a multiplatform solution? Cheers |
Beta Was this translation helpful? Give feedback.
-
Place this in MauiProgram.cs
Call above code in your CreateMauiApp() function |
Beta Was this translation helpful? Give feedback.
-
Wow, that was quick, many thanks, I'll give this a go. Cheers |
Beta Was this translation helpful? Give feedback.
-
Thanks for the workaround! |
Beta Was this translation helpful? Give feedback.
-
Is this not solved by #14918? |
Beta Was this translation helpful? Give feedback.
-
I am trying to become more familiar with .net MAUI and the app I was writing I decided I wanted to have a label with at most 2 lines of text and then truncate at the end or TailTruncation.
After running the code it was not working, it always had one line with the tail truncated, so I decided to look at the source and it appears that when the linebreakmode is set to TailTruncation the maui framework overrides my setting of maxlines and sets maxlines to 1.
Beta Was this translation helpful? Give feedback.
All reactions