-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RC1] Label MaxLines doesn't work #6030
Comments
@ram16g Are you seeing this on Android, or on a different platform? On Android, TailTruncation (and the other truncation options) does not support multiple lines. To be clear - the Android platform does support TailTruncation (TextUtils.TruncateAt.END) with multiple lines; for backward compatibility reasons, MAUI.Controls does not support combining multiple lines with TailTruncation. However, it's possible to customize the mapping behavior to support that combination. I'll try to post a demo of how to do that tomorrow. |
|
Example of how to customize your app to support multiple line Labels with TailTruncation: https://github.com/hartez/MultilineTruncate |
@hartez : In the example we read "This is a backward-compatibility carryover from Xamarin.Forms" and "However, Android does support some truncation modes ("Ellipsize", on Android) for multiple lines, and TailTruncation (TextUtils.TruncateAt.End on Android) is one of them". Wouldn't it be better to provide an opt-in for backwards Xamarin.Forms compatibility instead? |
Because we don't want to prevent current Forms users from easily moving to MAUI.Controls. Long term, we intend to update how MAUI.Core handles text wrapping, truncation, and multiple lines - see #5835. And once that happens, users will have an option to get the new behavior or keep the old one. |
Description
When set LineBreakMode,MaxLines doesn't work, it always show one line
Steps to Reproduce
<Label Text="Welcome to .NET Multi-platform App UI Welcome to .NET Multi-platform App UI ET Multi-platform App UI ET Multi-platform App UI ET Multi-platform App UI ET Multi-platform App UI Welcome to .NET Multi-platform App UI Welcome to .NET Multi-platform App UI Welcome to .NET Multi-platform App UI Welcome to .NET Multi-platform App UI" SemanticProperties.HeadingLevel="Level1" SemanticProperties.Description="Welcome to dot net Multi platform App U I" MaxLines="3" LineBreakMode="TailTruncation" FontSize="18" HorizontalOptions="Center" />
Version with bug
Release Candidate 1
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
ANDROID 10
Did you find any workaround?
no
Relevant log output
The text was updated successfully, but these errors were encountered: