-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Label doesn't render correctly #18034
Copy link
Copy link
Open
Labels
area-controls-labelLabel, SpanLabel, Spanarea-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterdelightermigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-controls-labelLabel, SpanLabel, Spanarea-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterdelightermigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
the label control doesn't render the text correctly, in this case I'm using vertical and horizontal stacklayouts but due to #10494 it seems that it has issues in Grid Layout too, so the Label control is a complete messed up in Maui, because it worked perfectly fine in Xamarin.Forms without specifying any
LineBreakModeorLineHeightandMaxLineproperties.so the problem is when the text of a label is too long, the text goes outside of it's parent (Layout) and also outside of the screen and doesn't respect setting of any
LineBreakModeorLineHeightandMaxLineproperties. no matter what, it wont render the text as a multiline label it shows just a single line label, let me show some code and screenshot:Case #1:
which results as the below picture:
but interestingly when you set the WidthRequest of Label, it seems that it works but it's not practical because when you use a horizontal stacklayout you just dont want to set the children's Width manually, you just want the children to fill their container.
so for Case #2:
result:

Steps to Reproduce
I modified the sample project of #10494 and added these two Cases, and i attach the sample project, please just run the project and see the results
LabelBug.zip
Link to public reproduction project repository
No response
Version with bug
7.0.96
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 8.0 and 12.0
Did you find any workaround?
No response
Relevant log output
No response