Skip to content
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

Closed
ram16g opened this issue Apr 13, 2022 · 6 comments
Closed

[RC1] Label MaxLines doesn't work #6030

ram16g opened this issue Apr 13, 2022 · 6 comments
Labels
area-controls-label Label, Span platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@ram16g
Copy link

ram16g commented Apr 13, 2022

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

NO
@ram16g ram16g added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 13, 2022
@hartez
Copy link
Contributor

hartez commented Apr 13, 2022

@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.

@jsuarezruiz jsuarezruiz added the area-controls-label Label, Span label Apr 13, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 13, 2022
@jsuarezruiz jsuarezruiz added platform/android 🤖 and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor labels Apr 13, 2022
@kristinx0211 kristinx0211 removed the s/needs-verification Indicates that this issue needs initial verification before further triage will happen label Apr 13, 2022
@kristinx0211
Copy link

verified exist on Android 11. show one line.
image

@kristinx0211 kristinx0211 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Apr 13, 2022
@ram16g
Copy link
Author

ram16g commented Apr 13, 2022

@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.
n't
This PR pr #5093 supposed to fix this bug,however it still doesn't work.

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 13, 2022
@hartez
Copy link
Contributor

hartez commented Apr 14, 2022

Example of how to customize your app to support multiple line Labels with TailTruncation: https://github.com/hartez/MultilineTruncate

@kasimier-vireq
Copy link

@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?
If MAUI wants to be a fresh start, then why carry over bugs from Xamarin.Forms?

@jsuarezruiz jsuarezruiz added this to the 6.0.300-rc.2 milestone Apr 18, 2022
@Redth Redth modified the milestones: 6.0.300-rc.2, 6.0.300-rc.3 Apr 20, 2022
@hartez
Copy link
Contributor

hartez commented Apr 23, 2022

Wouldn't it be better to provide an opt-in for backwards Xamarin.Forms compatibility instead?
If MAUI wants to be a fresh start, then why carry over bugs from Xamarin.Forms?

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.

@hartez hartez closed this as completed Apr 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 23, 2022
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-label Label, Span platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants